zova-vite 1.1.13 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +26 -0
- package/dist/vitePluginHmr.d.ts +2 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -650,6 +650,28 @@ function cssCollectPlugin(_config) {
|
|
|
650
650
|
};
|
|
651
651
|
}
|
|
652
652
|
|
|
653
|
+
function hmrPlugin(_config) {
|
|
654
|
+
const plugin = {
|
|
655
|
+
name: 'zova:hmr',
|
|
656
|
+
apply: 'serve',
|
|
657
|
+
hotUpdate({
|
|
658
|
+
modules,
|
|
659
|
+
timestamp
|
|
660
|
+
}) {
|
|
661
|
+
// Invalidate modules manually
|
|
662
|
+
const invalidatedModules = new Set();
|
|
663
|
+
for (const mod of modules) {
|
|
664
|
+
this.environment.moduleGraph.invalidateModule(mod, invalidatedModules, timestamp, true);
|
|
665
|
+
}
|
|
666
|
+
this.environment.hot.send({
|
|
667
|
+
type: 'full-reload'
|
|
668
|
+
});
|
|
669
|
+
return [];
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
return plugin;
|
|
673
|
+
}
|
|
674
|
+
|
|
653
675
|
function generateVitePlugins(configOptions, modulesMeta) {
|
|
654
676
|
const vitePlugins = [];
|
|
655
677
|
vitePlugins.push(__getVitePluginTs());
|
|
@@ -659,6 +681,7 @@ function generateVitePlugins(configOptions, modulesMeta) {
|
|
|
659
681
|
}
|
|
660
682
|
vitePlugins.push(__getVitePluginDevtoolsJson());
|
|
661
683
|
vitePlugins.push(__getVitePluginCss());
|
|
684
|
+
vitePlugins.push(__getVitePluginHmr());
|
|
662
685
|
// vitePlugins.push(__getVitePluginChecker(configOptions));
|
|
663
686
|
return vitePlugins;
|
|
664
687
|
|
|
@@ -712,6 +735,9 @@ function generateVitePlugins(configOptions, modulesMeta) {
|
|
|
712
735
|
function __getVitePluginCss() {
|
|
713
736
|
return ['vite-plugin-zova-css-collect', cssCollectPlugin, {}, undefined];
|
|
714
737
|
}
|
|
738
|
+
function __getVitePluginHmr() {
|
|
739
|
+
return ['vite-plugin-zova-hmr', hmrPlugin, {}, undefined];
|
|
740
|
+
}
|
|
715
741
|
function __getVitePluginMock(configOptions, _modulesMeta) {
|
|
716
742
|
const include = [];
|
|
717
743
|
__prepareMockIncludes(include, configOptions, modulesMeta);
|
package/package.json
CHANGED