nitro-nightly 4.0.0-20251030-121649-98b56dfe → 4.0.0-20251030-122449-2804f140

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.
@@ -633,6 +633,21 @@ function nitroMain(ctx) {
633
633
  configureServer: (server) => {
634
634
  debug("[main] Configuring dev server");
635
635
  return configureViteDevServer(ctx, server);
636
+ },
637
+ hotUpdate(options) {
638
+ if (this.environment.name === "client" || ctx.pluginConfig.experimental?.serverReload === false) return;
639
+ let hasServerOnlyModule = false;
640
+ const invalidated = /* @__PURE__ */ new Set();
641
+ for (const mod of options.modules) {
642
+ if (!mod.id) continue;
643
+ if (options.server.environments.client.moduleGraph.getModuleById(mod.id)) continue;
644
+ this.environment.moduleGraph.invalidateModule(mod, invalidated, options.timestamp, false);
645
+ hasServerOnlyModule = true;
646
+ }
647
+ if (hasServerOnlyModule) {
648
+ options.server.ws.send({ type: "full-reload" });
649
+ return [];
650
+ }
636
651
  }
637
652
  };
638
653
  }
package/dist/vite.d.mts CHANGED
@@ -37,6 +37,12 @@ interface NitroPluginConfig {
37
37
  * @default true
38
38
  */
39
39
  assetsImport?: boolean;
40
+ /**
41
+ * Reload the page when a server module is updated.
42
+ *
43
+ * @default true
44
+ */
45
+ serverReload: boolean;
40
46
  };
41
47
  }
42
48
  interface ServiceConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitro-nightly",
3
- "version": "4.0.0-20251030-121649-98b56dfe",
3
+ "version": "4.0.0-20251030-122449-2804f140",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "homepage": "https://nitro.build",
6
6
  "repository": "nitrojs/nitro",