@nuxt/nitro-server-nightly 4.3.0-29443555.c54d8292 → 4.3.0-29443617.eabd3fee

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.mjs CHANGED
@@ -19,7 +19,7 @@ import { isWindows } from 'std-env';
19
19
  import { ImpoundPlugin } from 'impound';
20
20
  import { resolveModulePath } from 'exsolve';
21
21
 
22
- const version = "4.3.0-29443555.c54d8292";
22
+ const version = "4.3.0-29443617.eabd3fee";
23
23
  const nitroBuilder = {
24
24
  version: version};
25
25
 
@@ -513,18 +513,33 @@ async function bundle(nuxt) {
513
513
  }
514
514
  });
515
515
  if (nuxt.options.experimental.payloadExtraction) {
516
+ if (nuxt.options.dev) {
517
+ nuxt.hook("nitro:config", (nitroConfig2) => {
518
+ nitroConfig2.prerender ||= {};
519
+ nitroConfig2.prerender.routes ||= [];
520
+ nitroConfig2.routeRules ||= {};
521
+ for (const route of nitroConfig2.prerender.routes) {
522
+ if (!route) {
523
+ continue;
524
+ }
525
+ nitroConfig2.routeRules[route] = defu(nitroConfig2.routeRules[route], { prerender: true });
526
+ }
527
+ });
528
+ }
516
529
  nuxt.hook("nitro:init", (nitro2) => {
517
530
  nitro2.hooks.hook("build:before", (nitro3) => {
518
531
  for (const [route, value] of Object.entries(nitro3.options.routeRules)) {
519
- if ((value.isr || value.cache) && !route.endsWith("*") && !route.endsWith("/_payload.json")) {
520
- const payloadKey = route + "/_payload.json";
521
- const defaults = {};
522
- for (const key of ["isr", "cache"]) {
523
- if (key in value) {
524
- defaults[key] = value[key];
532
+ if (!route.endsWith("*") && !route.endsWith("/_payload.json")) {
533
+ if (value.isr || value.cache || value.prerender && nuxt.options.dev) {
534
+ const payloadKey = route + "/_payload.json";
535
+ const defaults = {};
536
+ for (const key of ["isr", "cache", ...nuxt.options.dev ? ["prerender"] : []]) {
537
+ if (key in value) {
538
+ defaults[key] = value[key];
539
+ }
525
540
  }
541
+ nitro3.options.routeRules[payloadKey] = defu(nitro3.options.routeRules[payloadKey], defaults);
526
542
  }
527
- nitro3.options.routeRules[payloadKey] = defu(nitro3.options.routeRules[payloadKey], defaults);
528
543
  }
529
544
  }
530
545
  });
@@ -645,6 +660,10 @@ async function bundle(nuxt) {
645
660
  }
646
661
  };
647
662
  await nuxt.callHook("nitro:config", nitroConfig);
663
+ if (nitroConfig.static && nuxt.options.dev) {
664
+ nitroConfig.routeRules ||= {};
665
+ nitroConfig.routeRules["/**"] = defu(nitroConfig.routeRules["/**"], { prerender: true });
666
+ }
648
667
  const excludedAlias = [/^@vue\/.*$/, "vue", /vue-router/, "vite/client", "#imports", "vue-demi", /^#app/, "~", "@", "~~", "@@"];
649
668
  const basePath = nitroConfig.typescript.tsConfig.compilerOptions?.baseUrl ? resolve(nuxt.options.buildDir, nitroConfig.typescript.tsConfig.compilerOptions?.baseUrl) : nuxt.options.buildDir;
650
669
  const aliases = nitroConfig.alias;
@@ -57,7 +57,7 @@ export default defineRenderHandler(async (event) => {
57
57
  }
58
58
  const routeOptions = getRouteRules(event);
59
59
  const _PAYLOAD_EXTRACTION = !ssrContext.noSSR && (import.meta.prerender && NUXT_PAYLOAD_EXTRACTION || NUXT_RUNTIME_PAYLOAD_EXTRACTION && (routeOptions.isr || routeOptions.cache));
60
- const isRenderingPayload = _PAYLOAD_EXTRACTION && PAYLOAD_URL_RE.test(ssrContext.url);
60
+ const isRenderingPayload = (_PAYLOAD_EXTRACTION || import.meta.dev && routeOptions.prerender) && PAYLOAD_URL_RE.test(ssrContext.url);
61
61
  if (isRenderingPayload) {
62
62
  const url = ssrContext.url.substring(0, ssrContext.url.lastIndexOf("/")) || "/";
63
63
  ssrContext.url = url;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/nitro-server-nightly",
3
- "version": "4.3.0-29443555.c54d8292",
3
+ "version": "4.3.0-29443617.eabd3fee",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -19,7 +19,7 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "@nuxt/devalue": "^2.0.2",
22
- "@nuxt/kit": "npm:@nuxt/kit-nightly@4.3.0-29443555.c54d8292",
22
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@4.3.0-29443617.eabd3fee",
23
23
  "@unhead/vue": "^2.0.19",
24
24
  "@vue/shared": "^3.5.26",
25
25
  "consola": "^3.4.2",
@@ -47,11 +47,11 @@
47
47
  "vue-devtools-stub": "^0.1.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "nuxt": "npm:nuxt-nightly@4.3.0-29443555.c54d8292"
50
+ "nuxt": "npm:nuxt-nightly@4.3.0-29443617.eabd3fee"
51
51
  },
52
52
  "devDependencies": {
53
- "@nuxt/schema": "npm:@nuxt/schema-nightly@4.3.0-29443555.c54d8292",
54
- "nuxt": "npm:nuxt-nightly@4.3.0-29443555.c54d8292",
53
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@4.3.0-29443617.eabd3fee",
54
+ "nuxt": "npm:nuxt-nightly@4.3.0-29443617.eabd3fee",
55
55
  "unbuild": "3.6.1",
56
56
  "vitest": "3.2.4"
57
57
  },