Binbiubiubiu / unplugin-vue-jsx-hmr

Supports VUE2/3 non-SSR environments with hot-reload

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unplugin-vue-jsx-hmr

NPM version

Usage

Supports VUE2/3 non-SSR environments with hot-reload

Install

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 */ }),
    ],
  },
}


About

Supports VUE2/3 non-SSR environments with hot-reload

License:MIT License


Languages

Language:TypeScript 82.2%Language:CSS 13.3%Language:HTML 2.5%Language:JavaScript 2.0%