Skip to content

Vue JSX plugin for Vue 3, compatible with Rollup, Rolldown, Vite, esbuild, Webpack, and more.

License

Notifications You must be signed in to change notification settings

unplugin/unplugin-vue-jsx

unplugin-vue-jsx

npm version npm downloads Unit Test

  • Vue JSX plugin for Vue 3.
  • Supports Rollup, Rolldown, Vite, esbuild, Webpack and more.

Installation

npm i -D unplugin-vue-jsx
Vite
// vite.config.ts
import Starter from 'unplugin-vue-jsx/vite'

export default defineConfig({
  plugins: [Starter()],
})


Rollup
// rollup.config.js
import Starter from 'unplugin-vue-jsx/rollup'

export default {
  plugins: [Starter()],
}


Rolldown
// rolldown.config.js
import Starter from 'unplugin-vue-jsx/rolldown'

export default {
  plugins: [Starter()],
}


esbuild
import { build } from 'esbuild'
import Starter from 'unplugin-vue-jsx/esbuild'

build({
  plugins: [Starter()],
})


Webpack
// webpack.config.js
import Starter from 'unplugin-vue-jsx/webpack'

export default {
  /* ... */
  plugins: [Starter()],
}


Rspack
// rspack.config.js
import Starter from 'unplugin-vue-jsx/rspack'

export default {
  /* ... */
  plugins: [Starter()],
}


Configuration

The following show the default values of the configuration.

VueJsx({
  // filters for transforming targets
  include: [/\.[jt]sx$/],
  exclude: [/node_modules/],
  sourceMap: true,

  // See https://babeljs.io/docs/babel-parser#options
  parserOpts: {
    plugins: [
      /* ... */
    ],
  },

  // Use extra babel plugins
  babelPlugins: [],

  // Extra options from Vue Babel plugin: https://github.com/vuejs/babel-plugin-jsx#options
  // ...
})

Sponsors

License

MIT License © 2022-PRESENT Kevin Deng

About

Vue JSX plugin for Vue 3, compatible with Rollup, Rolldown, Vite, esbuild, Webpack, and more.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Contributors 3

  •  
  •  
  •