@bluejsx/vite-plugin-blue-hmr
v2.0.0-beta.0.0.0
Published
vite plugin for HMR with Bluejsx.
Readme
Vite Plugin Bluejsx HMR
This is a plugin to enable HMR (Hot Module Replacement) into your vite environment.
installation
npm i -D @bluejsx/vite-plugin-blue-hmrUsage
import HMRLoader, { transform } from '@bluejsx/vite-plugin-blue-hmr'transform
transform(code: string) : string- This takes in BlueJSX code and returns modified code which enables HMR
- This would be useful if you want to add HMR for other file formats (e.g.
.mdx)
HMRLoader plugin
/** @type {import('vite').UserConfig} */
export default ({
esbuild: {
jsxFactory: 'Blue.r',
jsxFragment: 'Blue.Fragment',
jsxInject: `import Blue from 'bluejsx'`
},
plugins: [
HMRLoader(),
],
base: './',
assetsInclude: 'public/*'
})