Supports VUE2/3 non-SSR environments with hot-reload
npm i unplugin-vue-jsx-hmr
Vite
// vite.config.ts
import Starter from 'unplugin-vue-jsx-hmr/vite'
// use vue2
import { viteCommonjs } from '@originjs/vite-plugin-commonjs'
export default defineConfig({
plugins: [
Starter({ /* options */ }),
// use vue2
viteCommonjs()
],
})
Example: playground/
Webpack
// webpack.config.js
module.exports = {
/* ... */
plugins: [
require('unplugin-vue-jsx-hmr/webpack')({ /* options */ })
]
}
Vue CLI
// vue.config.js
module.exports = {
configureWebpack: {
chainWebpack(config) {
config.module.rules.delete('tsx')
},
plugins: [
require('unplugin-vue-jsx-hmr/webpack')({ /* options */ }),
],
},
}