Skip to content

Vite plugin to import JSX components to different UI frameworks using mitosis

License

Notifications You must be signed in to change notification settings

az33zy/vite-plugin-mitosis

Repository files navigation

vite-plugin-mitosis

npm

Vite plugin to import JSX components to different UI frameworks using mitosis.

Warning

Currently, this is a Proof-of-Concept. It only works with Mitosis JSX to Svelte for now.

Installation

# npm
npm install --save-dev vite-plugin-mitosis

# yarn
yarn add -D vite-plugin-mitosis

# pnpm
pnpm add -D vite-plugin-mitosis

# bun
bun add -D vite-plugin-mitosis

Usage

SvelteKit

// vite.config.js
import { defineConfig } from 'vite';
import { svelteKit } from '@sveltejs/kit/vite';
import mitosis from 'vite-plugin-mitosis';

export default defineConfig({
  // ...
  plugins: [mitosis(), sveltekit()],
  //        ^ should go before sveltekit
});
// svelte.config.js
const config = {
  extensions: ['.svelte', '.jsx', '.tsx'],
};

Then JSX components can be imported as is:

import Button from '$lib/components/Button.jsx';

License

MIT

About

Vite plugin to import JSX components to different UI frameworks using mitosis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published