- run
yarn add vite-plugin-vue2 --dev
- add the plugin into
vite.config.js
// vite.config.js
const { createVuePlugin } = require('vite-plugin-vue2')
module.exports = {
plugins: [createVuePlugin(/*options*/)],
}
Type: Object
Default: null
The options for @vue/component-compiler-utils
.
Type: Boolean
Default: false
The options for jsx transform.
Type: Object
The options for @vue/babel-preset-jsx
.
// use jsx in SFC
<script lang="jsx">
export default {
name: 'TesxVueJSX',
data() {
return {
message: () => <div>JSX in SFC works!</div>,
};
},
components: {
TestSFCJsx
}
}
</script>
- SSR Build
- Sourcemap