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 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);
@@ -0,0 +1,2 @@
1
+ import type { Plugin } from 'vite';
2
+ export declare function hmrPlugin(_config: any): Plugin<any>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zova-vite",
3
- "version": "1.1.13",
4
- "gitHead": "4574f3873b1ad25eb6cdc8c44757a6c14dfc950d",
3
+ "version": "1.1.15",
4
+ "gitHead": "e3fd934a42a7e95cc934d2124bddfd634c25a305",
5
5
  "description": "zova vite",
6
6
  "keywords": [
7
7
  "framework",