vite-plugin-vue27-jsx
v1.0.1
Published
Vite plugin for Vue2.7.x
Downloads
7
Readme
vite-plugin-vue27-jsx
Vite plugin for Vue2.7.x
- vue文件内自动识别转换
<script lang="jsx"></script>
- js文件自动识别转换jsx
由于相关vite-plugin-vue2-jsx没有支持对应的vue2.7.x版本所以相关自己fork一份以及对应vite-plugin-vue2官方的vue2.7x插件结合了。
Install
npm install vite-plugin-vue27-jsx -D
// vite.config.js
import { createVuePlugin } from 'vite-plugin-vue27-jsx'
export default {
plugins: [
createVuePlugin(/* options */)
],
}
主要是将vite-plugin-vue2-jsx的vueTemplateOptions
配置移除,由vite-plugin-vue2 中的options
中template
控制, 以及移除了一些不需要的依赖比如vue-template-compiler
。
`
项目配置options
来源于 vite-plugin-vue2-jsx与vite-plugin-vue2 结合具体可跳转查看
[Options]
jsx
Type: Boolean
Default: false
jsx 转换的选项。
jsxOptions
Type: Object
The options for @vue/babel-preset-jsx
.
target
Type: String
esbuild 转换脚本代码的选项