vite-plugin-js-app
v0.1.1
Published
HMR dev support for JS APP object which different from SFC format/VUE js对象形式的开发热更新支持
Downloads
20
Readme
vite-plugin-jsApp
- support for
export default {name,template ,setup,css}vue Object /支持以js对象导出形式的vue组件 的编译热更新,runtime要带dom compile功能 - detect really change and emit HMR.such as comment in js and css won't update/检测真正的文件修改来进行热更新,排除了在js文件里面调整格式 添加注释这种跟代码无关的改变
- support css in JS render 2025-03-16/添加了vue对象中的css编译支持
vue object format js-app /js app形式的VUE对象
import {ref} from 'vue'
export default {
name:'app',
template:/html/<div>
<h2>hello</h2>
Welcome pure JS-vue developer
<div class=user>user</div>
</div>,
css:/css/h2{color:red} .user{text-align:right;},
setup(){
const user = ref('')
return {user}
}
}
vite.config.js 的示例 ,原来插件名称vite-plugin-real-hmr
import jsApp from 'vite-plugin-js-app';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
jsApp()
],
})