Skip to content

Vue JSX plugin for both Vue 2 and 3. Support Rollup, Vite, esbuild, Webpack, and more.

License

Notifications You must be signed in to change notification settings

unplugin/unplugin-vue-jsx

Folders and files

NameName
Last commit message
Last commit date
Feb 14, 2025
Feb 14, 2025
Feb 14, 2025
Feb 14, 2025
Jul 9, 2022
Jul 9, 2022
Jun 12, 2023
Jul 7, 2023
Aug 31, 2023
Jan 20, 2025
Apr 7, 2025
Apr 7, 2025
Feb 14, 2025
Feb 14, 2025

Repository files navigation

unplugin-vue-jsx npm

Unit Test

  • Vue JSX plugin for both Vue 2 and 3.
  • Supports Rollup, Vite, esbuild and Webpack.

Installation

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

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


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

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


esbuild
// esbuild.config.js
import { build } from 'esbuild'

build({
  plugins: [require('unplugin-vue-jsx/esbuild')()],
})


Webpack
// webpack.config.js
module.exports = {
  /* ... */
  plugins: [require('unplugin-vue-jsx/webpack')()],
}


Vue CLI
// vue.config.js
module.exports = {
  configureWebpack: {
    plugins: [require('unplugin-vue-jsx/webpack')()],
  },
}


Configuration

The following show the default values of the configuration.

VueJsx({
  // filters for transforming targets
  include: [/\.[jt]sx?$/],
  exclude: undefined,

  root: process.cwd(),
  sourceMap: true,

  /** detect vue version from node_modules automatically */
  version: 'auto',

  // extra options from babel plugin
  // Vue 2 options: https://github.com/vuejs/jsx-vue2/tree/dev/packages/babel-preset-jsx#usage
  // Vue 3 options: https://github.com/vuejs/babel-plugin-jsx#options
})

Sponsors

License

MIT License © 2022-PRESENT 三咲智子