1.0.4 • Published 16 days ago

vite-plugin-change-jsx-factory v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
16 days ago

rollup-plugin-swap-module

A simple vite plugin to change the jsx factory of esbuild.

installation

npm install vite-plugin-change-jsx-factory -D

usage

To use this plugin with an already existing package that exports a createElement function you should pass the package name to the plugin like this:

// vite.config.js
import { defineConfig } from 'vite';
import changeJSXFactory from 'vite-plugin-change-jsx-factory';

export default defineConfig({
  // config options
  plugins: [changeJSXFactory('your-package-name')],
});

or alternatively, you could create your own createElement function and pass it to the plugin:

// vite.config.js
import { defineConfig } from 'vite';
import changeJSXFactory from 'vite-plugin-change-jsx-factory';

// see https://esbuild.github.io/api/#jsx-factory
function createElement(type, config, children){
    ...
}

export default defineConfig({
  // config options
  plugins: [changeJSXFactory(createElement)],
});
1.0.4

16 days ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago