v-if & v-for directive from jsx
unplugin-jsx-vue-directive
v-if
& v-for
directive for jsx.
Thank for @sxzz.
TODO:
-
v-for
TypeScript support
Installation
npm i -D unplugin-jsx-vue-directive
// vite.config.ts
import UnpluginStarter from 'unplugin-jsx-vue-directive/vite'
export default defineConfig({
plugins: [UnpluginStarter()],
})
// rollup.config.js
import UnpluginStarter from 'unplugin-jsx-vue-directive/rollup'
export default {
plugins: [UnpluginStarter()],
}
// esbuild.config.js
import { build } from 'esbuild'
build({
plugins: [require('unplugin-jsx-vue-directive/esbuild')()],
})
// webpack.config.js
module.exports = {
/* ... */
plugins: [require('unplugin-jsx-vue-directive/webpack')()],
}
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [require('unplugin-jsx-vue-directive/webpack')()],
},
}
License
MIT License © 2023-PRESENT zhiyuanzmj