unplugin-jsx-vue-directive

v-if & v-for directive for jsx.

Thank for @sxzz.

image

TODO:

  • v-for TypeScript support

Installation

npm i -D unplugin-jsx-vue-directive
Vite

// vite.config.ts
import UnpluginStarter from 'unplugin-jsx-vue-directive/vite'

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

// rollup.config.js
import UnpluginStarter from 'unplugin-jsx-vue-directive/rollup'

export default {
  plugins: [UnpluginStarter()],
}
esbuild

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

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

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

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

License

MIT License © 2023-PRESENT zhiyuanzmj

GitHub

View Github