vinext 0.0.52 → 0.0.54
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/README.md +1 -1
- package/dist/build/clean-output.d.ts +14 -0
- package/dist/build/clean-output.js +36 -0
- package/dist/build/clean-output.js.map +1 -0
- package/dist/build/inline-css.d.ts +7 -0
- package/dist/build/inline-css.js +50 -0
- package/dist/build/inline-css.js.map +1 -0
- package/dist/build/prerender.d.ts +6 -2
- package/dist/build/prerender.js +51 -12
- package/dist/build/prerender.js.map +1 -1
- package/dist/build/run-prerender.js +10 -1
- package/dist/build/run-prerender.js.map +1 -1
- package/dist/build/static-export.d.ts +5 -0
- package/dist/build/static-export.js +8 -3
- package/dist/build/static-export.js.map +1 -1
- package/dist/check.js +4 -0
- package/dist/check.js.map +1 -1
- package/dist/cli.js +19 -4
- package/dist/cli.js.map +1 -1
- package/dist/client/instrumentation-client-inject.d.ts +34 -0
- package/dist/client/instrumentation-client-inject.js +57 -0
- package/dist/client/instrumentation-client-inject.js.map +1 -0
- package/dist/client/navigation-runtime.d.ts +16 -2
- package/dist/client/navigation-runtime.js +16 -1
- package/dist/client/navigation-runtime.js.map +1 -1
- package/dist/client/vinext-next-data.d.ts +2 -1
- package/dist/client/vinext-next-data.js.map +1 -1
- package/dist/client/window-next.d.ts +17 -2
- package/dist/client/window-next.js.map +1 -1
- package/dist/cloudflare/tpr.js +1 -1
- package/dist/cloudflare/tpr.js.map +1 -1
- package/dist/config/config-matchers.js +2 -1
- package/dist/config/config-matchers.js.map +1 -1
- package/dist/config/next-config.d.ts +95 -4
- package/dist/config/next-config.js +173 -14
- package/dist/config/next-config.js.map +1 -1
- package/dist/deploy.js +42 -7
- package/dist/deploy.js.map +1 -1
- package/dist/entries/app-browser-entry.d.ts +11 -1
- package/dist/entries/app-browser-entry.js +16 -6
- package/dist/entries/app-browser-entry.js.map +1 -1
- package/dist/entries/app-rsc-entry.d.ts +12 -3
- package/dist/entries/app-rsc-entry.js +41 -8
- package/dist/entries/app-rsc-entry.js.map +1 -1
- package/dist/entries/app-rsc-manifest.d.ts +21 -1
- package/dist/entries/app-rsc-manifest.js +6 -4
- package/dist/entries/app-rsc-manifest.js.map +1 -1
- package/dist/entries/pages-client-entry.d.ts +4 -1
- package/dist/entries/pages-client-entry.js +40 -3
- package/dist/entries/pages-client-entry.js.map +1 -1
- package/dist/entries/pages-server-entry.js +292 -34
- package/dist/entries/pages-server-entry.js.map +1 -1
- package/dist/entries/runtime-entry-module.d.ts +1 -10
- package/dist/entries/runtime-entry-module.js +2 -12
- package/dist/entries/runtime-entry-module.js.map +1 -1
- package/dist/index.js +91 -10
- package/dist/index.js.map +1 -1
- package/dist/plugins/fonts.js +25 -2
- package/dist/plugins/fonts.js.map +1 -1
- package/dist/plugins/remove-console.d.ts +16 -0
- package/dist/plugins/remove-console.js +176 -0
- package/dist/plugins/remove-console.js.map +1 -0
- package/dist/routing/app-route-graph.d.ts +24 -1
- package/dist/routing/app-route-graph.js +52 -4
- package/dist/routing/app-route-graph.js.map +1 -1
- package/dist/routing/app-router.d.ts +2 -2
- package/dist/routing/app-router.js +2 -2
- package/dist/routing/app-router.js.map +1 -1
- package/dist/routing/file-matcher.d.ts +21 -1
- package/dist/routing/file-matcher.js +39 -1
- package/dist/routing/file-matcher.js.map +1 -1
- package/dist/routing/pages-router.d.ts +1 -1
- package/dist/routing/pages-router.js +10 -3
- package/dist/routing/pages-router.js.map +1 -1
- package/dist/routing/route-trie.js +13 -18
- package/dist/routing/route-trie.js.map +1 -1
- package/dist/routing/utils.d.ts +11 -1
- package/dist/routing/utils.js +15 -1
- package/dist/routing/utils.js.map +1 -1
- package/dist/server/api-handler.js +19 -10
- package/dist/server/api-handler.js.map +1 -1
- package/dist/server/app-browser-action-result.d.ts +16 -1
- package/dist/server/app-browser-action-result.js +15 -1
- package/dist/server/app-browser-action-result.js.map +1 -1
- package/dist/server/app-browser-entry.js +47 -28
- package/dist/server/app-browser-entry.js.map +1 -1
- package/dist/server/app-browser-navigation-controller.d.ts +2 -0
- package/dist/server/app-browser-navigation-controller.js +4 -0
- package/dist/server/app-browser-navigation-controller.js.map +1 -1
- package/dist/server/app-elements-wire.d.ts +13 -4
- package/dist/server/app-elements-wire.js +10 -1
- package/dist/server/app-elements-wire.js.map +1 -1
- package/dist/server/app-elements.d.ts +2 -2
- package/dist/server/app-elements.js +2 -2
- package/dist/server/app-elements.js.map +1 -1
- package/dist/server/app-fallback-renderer.d.ts +27 -8
- package/dist/server/app-fallback-renderer.js +19 -8
- package/dist/server/app-fallback-renderer.js.map +1 -1
- package/dist/server/app-history-state.js +6 -2
- package/dist/server/app-history-state.js.map +1 -1
- package/dist/server/app-inline-css-client.d.ts +7 -0
- package/dist/server/app-inline-css-client.js +37 -0
- package/dist/server/app-inline-css-client.js.map +1 -0
- package/dist/server/app-interception-context-header.d.ts +33 -0
- package/dist/server/app-interception-context-header.js +44 -0
- package/dist/server/app-interception-context-header.js.map +1 -0
- package/dist/server/app-mounted-slots-header.d.ts +19 -0
- package/dist/server/app-mounted-slots-header.js +40 -1
- package/dist/server/app-mounted-slots-header.js.map +1 -1
- package/dist/server/app-optimistic-routing.js +26 -18
- package/dist/server/app-optimistic-routing.js.map +1 -1
- package/dist/server/app-page-boundary-render.d.ts +1 -0
- package/dist/server/app-page-boundary-render.js +2 -0
- package/dist/server/app-page-boundary-render.js.map +1 -1
- package/dist/server/app-page-boundary.d.ts +22 -1
- package/dist/server/app-page-boundary.js +30 -3
- package/dist/server/app-page-boundary.js.map +1 -1
- package/dist/server/app-page-cache.d.ts +9 -3
- package/dist/server/app-page-cache.js +14 -8
- package/dist/server/app-page-cache.js.map +1 -1
- package/dist/server/app-page-dispatch.d.ts +13 -1
- package/dist/server/app-page-dispatch.js +136 -82
- package/dist/server/app-page-dispatch.js.map +1 -1
- package/dist/server/app-page-element-builder.d.ts +2 -1
- package/dist/server/app-page-element-builder.js +17 -30
- package/dist/server/app-page-element-builder.js.map +1 -1
- package/dist/server/app-page-execution.d.ts +1 -0
- package/dist/server/app-page-execution.js +2 -0
- package/dist/server/app-page-execution.js.map +1 -1
- package/dist/server/app-page-head.d.ts +1 -0
- package/dist/server/app-page-head.js +8 -0
- package/dist/server/app-page-head.js.map +1 -1
- package/dist/server/app-page-render-identity.d.ts +22 -0
- package/dist/server/app-page-render-identity.js +42 -0
- package/dist/server/app-page-render-identity.js.map +1 -0
- package/dist/server/app-page-render-observation.js +1 -1
- package/dist/server/app-page-render.d.ts +9 -1
- package/dist/server/app-page-render.js +8 -2
- package/dist/server/app-page-render.js.map +1 -1
- package/dist/server/app-page-request.d.ts +6 -3
- package/dist/server/app-page-request.js +5 -2
- package/dist/server/app-page-request.js.map +1 -1
- package/dist/server/app-page-response.d.ts +11 -1
- package/dist/server/app-page-response.js +16 -4
- package/dist/server/app-page-response.js.map +1 -1
- package/dist/server/app-page-route-wiring.d.ts +16 -0
- package/dist/server/app-page-route-wiring.js +25 -10
- package/dist/server/app-page-route-wiring.js.map +1 -1
- package/dist/server/app-page-stream.d.ts +12 -0
- package/dist/server/app-page-stream.js +3 -0
- package/dist/server/app-page-stream.js.map +1 -1
- package/dist/server/app-route-handler-dispatch.d.ts +1 -0
- package/dist/server/app-route-handler-dispatch.js +3 -0
- package/dist/server/app-route-handler-dispatch.js.map +1 -1
- package/dist/server/app-route-handler-execution.d.ts +1 -0
- package/dist/server/app-route-handler-execution.js +1 -0
- package/dist/server/app-route-handler-execution.js.map +1 -1
- package/dist/server/app-route-handler-response.js +38 -6
- package/dist/server/app-route-handler-response.js.map +1 -1
- package/dist/server/app-rsc-handler.d.ts +16 -3
- package/dist/server/app-rsc-handler.js +60 -11
- package/dist/server/app-rsc-handler.js.map +1 -1
- package/dist/server/app-rsc-request-normalization.d.ts +2 -1
- package/dist/server/app-rsc-request-normalization.js +6 -4
- package/dist/server/app-rsc-request-normalization.js.map +1 -1
- package/dist/server/app-segment-config.d.ts +4 -1
- package/dist/server/app-segment-config.js +6 -1
- package/dist/server/app-segment-config.js.map +1 -1
- package/dist/server/app-server-action-execution.d.ts +22 -3
- package/dist/server/app-server-action-execution.js +46 -7
- package/dist/server/app-server-action-execution.js.map +1 -1
- package/dist/server/app-ssr-entry.d.ts +6 -0
- package/dist/server/app-ssr-entry.js +57 -6
- package/dist/server/app-ssr-entry.js.map +1 -1
- package/dist/server/app-ssr-error-meta.js +3 -3
- package/dist/server/app-ssr-error-meta.js.map +1 -1
- package/dist/server/app-ssr-stream.d.ts +25 -1
- package/dist/server/app-ssr-stream.js +237 -19
- package/dist/server/app-ssr-stream.js.map +1 -1
- package/dist/server/app-static-generation.d.ts +1 -0
- package/dist/server/app-static-generation.js +2 -1
- package/dist/server/app-static-generation.js.map +1 -1
- package/dist/server/client-trace-metadata.d.ts +31 -0
- package/dist/server/client-trace-metadata.js +83 -0
- package/dist/server/client-trace-metadata.js.map +1 -0
- package/dist/server/cookie-utils.d.ts +13 -0
- package/dist/server/cookie-utils.js +20 -0
- package/dist/server/cookie-utils.js.map +1 -0
- package/dist/server/default-not-found-module.d.ts +20 -0
- package/dist/server/default-not-found-module.js +20 -0
- package/dist/server/default-not-found-module.js.map +1 -0
- package/dist/server/dev-server.d.ts +8 -1
- package/dist/server/dev-server.js +56 -11
- package/dist/server/dev-server.js.map +1 -1
- package/dist/server/headers.d.ts +5 -1
- package/dist/server/headers.js +5 -1
- package/dist/server/headers.js.map +1 -1
- package/dist/server/html.d.ts +2 -1
- package/dist/server/html.js +6 -1
- package/dist/server/html.js.map +1 -1
- package/dist/server/image-optimization.d.ts +13 -4
- package/dist/server/image-optimization.js +15 -4
- package/dist/server/image-optimization.js.map +1 -1
- package/dist/server/isr-cache.d.ts +7 -5
- package/dist/server/isr-cache.js +17 -6
- package/dist/server/isr-cache.js.map +1 -1
- package/dist/server/middleware-runtime.js +1 -2
- package/dist/server/middleware-runtime.js.map +1 -1
- package/dist/server/middleware.js +1 -1
- package/dist/server/middleware.js.map +1 -1
- package/dist/server/pages-api-route.d.ts +18 -0
- package/dist/server/pages-api-route.js +3 -1
- package/dist/server/pages-api-route.js.map +1 -1
- package/dist/server/pages-body-parser-config.d.ts +60 -0
- package/dist/server/pages-body-parser-config.js +79 -0
- package/dist/server/pages-body-parser-config.js.map +1 -0
- package/dist/server/pages-data-route.js +1 -0
- package/dist/server/pages-data-route.js.map +1 -1
- package/dist/server/pages-default-404.d.ts +31 -0
- package/dist/server/pages-default-404.js +40 -0
- package/dist/server/pages-default-404.js.map +1 -0
- package/dist/server/pages-document-initial-props.d.ts +7 -0
- package/dist/server/pages-document-initial-props.js +14 -0
- package/dist/server/pages-document-initial-props.js.map +1 -0
- package/dist/server/pages-node-compat.d.ts +10 -0
- package/dist/server/pages-node-compat.js +12 -1
- package/dist/server/pages-node-compat.js.map +1 -1
- package/dist/server/pages-page-data.d.ts +40 -0
- package/dist/server/pages-page-data.js +19 -14
- package/dist/server/pages-page-data.js.map +1 -1
- package/dist/server/pages-page-method.d.ts +48 -0
- package/dist/server/pages-page-method.js +19 -0
- package/dist/server/pages-page-method.js.map +1 -0
- package/dist/server/pages-page-response.d.ts +8 -0
- package/dist/server/pages-page-response.js +21 -11
- package/dist/server/pages-page-response.js.map +1 -1
- package/dist/server/pages-serializable-props.d.ts +25 -0
- package/dist/server/pages-serializable-props.js +69 -0
- package/dist/server/pages-serializable-props.js.map +1 -0
- package/dist/server/prerender-route-params.d.ts +14 -0
- package/dist/server/prerender-route-params.js +94 -0
- package/dist/server/prerender-route-params.js.map +1 -0
- package/dist/server/prod-server.d.ts +3 -23
- package/dist/server/prod-server.js +43 -57
- package/dist/server/prod-server.js.map +1 -1
- package/dist/server/proxy-trust.d.ts +41 -0
- package/dist/server/proxy-trust.js +70 -0
- package/dist/server/proxy-trust.js.map +1 -0
- package/dist/server/request-pipeline.d.ts +3 -3
- package/dist/server/request-pipeline.js +5 -4
- package/dist/server/request-pipeline.js.map +1 -1
- package/dist/server/seed-cache.js +12 -6
- package/dist/server/seed-cache.js.map +1 -1
- package/dist/server/server-action-not-found.js +3 -2
- package/dist/server/server-action-not-found.js.map +1 -1
- package/dist/server/static-file-cache.js +2 -1
- package/dist/server/static-file-cache.js.map +1 -1
- package/dist/server/streaming-metadata.d.ts +5 -0
- package/dist/server/streaming-metadata.js +10 -0
- package/dist/server/streaming-metadata.js.map +1 -0
- package/dist/shims/app-router-scroll-state.d.ts +14 -0
- package/dist/shims/app-router-scroll-state.js +51 -0
- package/dist/shims/app-router-scroll-state.js.map +1 -0
- package/dist/shims/app-router-scroll.d.ts +28 -0
- package/dist/shims/app-router-scroll.js +115 -0
- package/dist/shims/app-router-scroll.js.map +1 -0
- package/dist/shims/before-interactive-context.d.ts +30 -0
- package/dist/shims/before-interactive-context.js +10 -0
- package/dist/shims/before-interactive-context.js.map +1 -0
- package/dist/shims/cache-runtime.d.ts +1 -1
- package/dist/shims/cache-runtime.js +14 -1
- package/dist/shims/cache-runtime.js.map +1 -1
- package/dist/shims/cache.d.ts +6 -0
- package/dist/shims/cache.js +7 -0
- package/dist/shims/cache.js.map +1 -1
- package/dist/shims/default-not-found.d.ts +12 -0
- package/dist/shims/default-not-found.js +61 -0
- package/dist/shims/default-not-found.js.map +1 -0
- package/dist/shims/error.js +3 -0
- package/dist/shims/error.js.map +1 -1
- package/dist/shims/font-local.d.ts +5 -0
- package/dist/shims/font-local.js +6 -2
- package/dist/shims/font-local.js.map +1 -1
- package/dist/shims/head.js +4 -4
- package/dist/shims/head.js.map +1 -1
- package/dist/shims/headers.d.ts +13 -2
- package/dist/shims/headers.js +73 -22
- package/dist/shims/headers.js.map +1 -1
- package/dist/shims/image.d.ts +1 -1
- package/dist/shims/image.js +4 -4
- package/dist/shims/image.js.map +1 -1
- package/dist/shims/internal/app-route-detection.d.ts +37 -0
- package/dist/shims/internal/app-route-detection.js +69 -0
- package/dist/shims/internal/app-route-detection.js.map +1 -0
- package/dist/shims/internal/pages-data-target.d.ts +58 -0
- package/dist/shims/internal/pages-data-target.js +91 -0
- package/dist/shims/internal/pages-data-target.js.map +1 -0
- package/dist/shims/internal/pages-data-url.d.ts +42 -0
- package/dist/shims/internal/pages-data-url.js +73 -0
- package/dist/shims/internal/pages-data-url.js.map +1 -0
- package/dist/shims/link.d.ts +18 -2
- package/dist/shims/link.js +129 -15
- package/dist/shims/link.js.map +1 -1
- package/dist/shims/metadata.d.ts +9 -7
- package/dist/shims/metadata.js +70 -7
- package/dist/shims/metadata.js.map +1 -1
- package/dist/shims/navigation.d.ts +1 -2
- package/dist/shims/navigation.js +94 -20
- package/dist/shims/navigation.js.map +1 -1
- package/dist/shims/router.d.ts +5 -0
- package/dist/shims/router.js +389 -80
- package/dist/shims/router.js.map +1 -1
- package/dist/shims/script.d.ts +11 -1
- package/dist/shims/script.js +158 -15
- package/dist/shims/script.js.map +1 -1
- package/dist/shims/server.js +1 -0
- package/dist/shims/server.js.map +1 -1
- package/dist/shims/url-utils.d.ts +2 -1
- package/dist/shims/url-utils.js +15 -4
- package/dist/shims/url-utils.js.map +1 -1
- package/dist/utils/html-limited-bots.d.ts +5 -0
- package/dist/utils/html-limited-bots.js +15 -0
- package/dist/utils/html-limited-bots.js.map +1 -0
- package/dist/utils/path.d.ts +13 -0
- package/dist/utils/path.js +16 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/query.d.ts +6 -0
- package/dist/utils/query.js +10 -1
- package/dist/utils/query.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -558,7 +558,7 @@ These are intentional exclusions. For things that are missing today but on the r
|
|
|
558
558
|
|
|
559
559
|
These are gaps we'd like to close — distinct from the [intentional exclusions](#whats-not-supported-and-wont-be) above.
|
|
560
560
|
|
|
561
|
-
- **Image optimization doesn't happen at build time.** Remote images work via `@unpic/react` (auto-detects 28 CDN providers). Local images are routed through a `/
|
|
561
|
+
- **Image optimization doesn't happen at build time.** Remote images work via `@unpic/react` (auto-detects 28 CDN providers). Local images are routed through a `/_next/image` endpoint that can resize and transcode on Cloudflare Workers (via the Images binding) in production, but no build-time optimization or static resizing occurs.
|
|
562
562
|
- **Google Fonts are loaded from the CDN, not self-hosted.** No `size-adjust` fallback font metrics. Local fonts work but `@font-face` CSS is injected at runtime, not extracted at build time.
|
|
563
563
|
- **Route segment config** — `runtime` and `preferredRegion` are ignored (everything runs in the same environment).
|
|
564
564
|
- **Node.js production server (`vinext start`)** works for testing but is less complete than Workers deployment. Cloudflare Workers is the primary target.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/build/clean-output.d.ts
|
|
2
|
+
type CleanBuildOutputOptions = {
|
|
3
|
+
root: string;
|
|
4
|
+
outDir?: string;
|
|
5
|
+
emptyOutDir?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type CleanBuildOutputResult = {
|
|
8
|
+
cleaned: boolean;
|
|
9
|
+
outDir: string;
|
|
10
|
+
};
|
|
11
|
+
declare function cleanBuildOutput(options: CleanBuildOutputOptions): CleanBuildOutputResult;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { cleanBuildOutput };
|
|
14
|
+
//# sourceMappingURL=clean-output.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
//#region src/build/clean-output.ts
|
|
4
|
+
function resolveOutDir(root, outDir) {
|
|
5
|
+
const resolvedRoot = path.resolve(root);
|
|
6
|
+
if (!outDir) return path.join(resolvedRoot, "dist");
|
|
7
|
+
return path.isAbsolute(outDir) ? outDir : path.resolve(resolvedRoot, outDir);
|
|
8
|
+
}
|
|
9
|
+
function isPathInsideOrEqual(parent, child) {
|
|
10
|
+
const relative = path.relative(parent, child);
|
|
11
|
+
return relative === "" || !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
12
|
+
}
|
|
13
|
+
function shouldCleanBuildOutput(options) {
|
|
14
|
+
if (options.emptyOutDir === false) return false;
|
|
15
|
+
if (options.emptyOutDir === true) return true;
|
|
16
|
+
return isPathInsideOrEqual(path.resolve(options.root), resolveOutDir(options.root, options.outDir));
|
|
17
|
+
}
|
|
18
|
+
function cleanBuildOutput(options) {
|
|
19
|
+
const outDir = resolveOutDir(options.root, options.outDir);
|
|
20
|
+
if (!shouldCleanBuildOutput(options)) return {
|
|
21
|
+
cleaned: false,
|
|
22
|
+
outDir
|
|
23
|
+
};
|
|
24
|
+
fs.rmSync(outDir, {
|
|
25
|
+
recursive: true,
|
|
26
|
+
force: true
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
cleaned: true,
|
|
30
|
+
outDir
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { cleanBuildOutput };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=clean-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean-output.js","names":[],"sources":["../../src/build/clean-output.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\n\ntype CleanBuildOutputOptions = {\n root: string;\n outDir?: string;\n emptyOutDir?: boolean;\n};\n\ntype CleanBuildOutputResult = {\n cleaned: boolean;\n outDir: string;\n};\n\nfunction resolveOutDir(root: string, outDir: string | undefined): string {\n const resolvedRoot = path.resolve(root);\n if (!outDir) return path.join(resolvedRoot, \"dist\");\n return path.isAbsolute(outDir) ? outDir : path.resolve(resolvedRoot, outDir);\n}\n\nfunction isPathInsideOrEqual(parent: string, child: string): boolean {\n const relative = path.relative(parent, child);\n return relative === \"\" || (!relative.startsWith(\"..\") && !path.isAbsolute(relative));\n}\n\nfunction shouldCleanBuildOutput(options: CleanBuildOutputOptions): boolean {\n if (options.emptyOutDir === false) return false;\n if (options.emptyOutDir === true) return true;\n\n return isPathInsideOrEqual(\n path.resolve(options.root),\n resolveOutDir(options.root, options.outDir),\n );\n}\n\nexport function cleanBuildOutput(options: CleanBuildOutputOptions): CleanBuildOutputResult {\n const outDir = resolveOutDir(options.root, options.outDir);\n if (!shouldCleanBuildOutput(options)) return { cleaned: false, outDir };\n\n fs.rmSync(outDir, { recursive: true, force: true });\n return { cleaned: true, outDir };\n}\n"],"mappings":";;;AAcA,SAAS,cAAc,MAAc,QAAoC;CACvE,MAAM,eAAe,KAAK,QAAQ,KAAK;CACvC,IAAI,CAAC,QAAQ,OAAO,KAAK,KAAK,cAAc,OAAO;CACnD,OAAO,KAAK,WAAW,OAAO,GAAG,SAAS,KAAK,QAAQ,cAAc,OAAO;;AAG9E,SAAS,oBAAoB,QAAgB,OAAwB;CACnE,MAAM,WAAW,KAAK,SAAS,QAAQ,MAAM;CAC7C,OAAO,aAAa,MAAO,CAAC,SAAS,WAAW,KAAK,IAAI,CAAC,KAAK,WAAW,SAAS;;AAGrF,SAAS,uBAAuB,SAA2C;CACzE,IAAI,QAAQ,gBAAgB,OAAO,OAAO;CAC1C,IAAI,QAAQ,gBAAgB,MAAM,OAAO;CAEzC,OAAO,oBACL,KAAK,QAAQ,QAAQ,KAAK,EAC1B,cAAc,QAAQ,MAAM,QAAQ,OAAO,CAC5C;;AAGH,SAAgB,iBAAiB,SAA0D;CACzF,MAAM,SAAS,cAAc,QAAQ,MAAM,QAAQ,OAAO;CAC1D,IAAI,CAAC,uBAAuB,QAAQ,EAAE,OAAO;EAAE,SAAS;EAAO;EAAQ;CAEvE,GAAG,OAAO,QAAQ;EAAE,WAAW;EAAM,OAAO;EAAM,CAAC;CACnD,OAAO;EAAE,SAAS;EAAM;EAAQ"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/build/inline-css.d.ts
|
|
2
|
+
type InlineCssManifest = Record<string, string>;
|
|
3
|
+
declare function collectInlineCssManifest(clientDir: string, assetPrefix: string): InlineCssManifest;
|
|
4
|
+
declare function injectInlineCssManifestGlobal(entryPath: string, manifest: InlineCssManifest): boolean;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { collectInlineCssManifest, injectInlineCssManifestGlobal };
|
|
7
|
+
//# sourceMappingURL=inline-css.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { resolveAssetUrlPrefix, resolveAssetsDir } from "../utils/asset-prefix.js";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
//#region src/build/inline-css.ts
|
|
5
|
+
const INLINE_CSS_GLOBAL_MARKER = "globalThis.__VINEXT_INLINE_CSS__ = ";
|
|
6
|
+
function collectCssFiles(directory) {
|
|
7
|
+
const files = [];
|
|
8
|
+
for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
|
|
9
|
+
const filePath = path.join(directory, entry.name);
|
|
10
|
+
if (entry.isDirectory()) files.push(...collectCssFiles(filePath));
|
|
11
|
+
else if (entry.isFile() && entry.name.endsWith(".css")) files.push(filePath);
|
|
12
|
+
}
|
|
13
|
+
return files;
|
|
14
|
+
}
|
|
15
|
+
function toUrlPath(filePath) {
|
|
16
|
+
return filePath.split(path.sep).join("/");
|
|
17
|
+
}
|
|
18
|
+
function addPathnameAlias(manifest, href, css) {
|
|
19
|
+
try {
|
|
20
|
+
const url = new URL(href);
|
|
21
|
+
manifest[url.pathname] = css;
|
|
22
|
+
} catch {}
|
|
23
|
+
}
|
|
24
|
+
function collectInlineCssManifest(clientDir, assetPrefix) {
|
|
25
|
+
const assetsDir = path.join(clientDir, resolveAssetsDir(assetPrefix));
|
|
26
|
+
if (!fs.existsSync(assetsDir)) return {};
|
|
27
|
+
const urlPrefix = resolveAssetUrlPrefix(assetPrefix);
|
|
28
|
+
const manifest = {};
|
|
29
|
+
for (const filePath of collectCssFiles(assetsDir)) {
|
|
30
|
+
const href = `${urlPrefix}${toUrlPath(path.relative(assetsDir, filePath))}`;
|
|
31
|
+
const css = fs.readFileSync(filePath, "utf8");
|
|
32
|
+
manifest[href] = css;
|
|
33
|
+
addPathnameAlias(manifest, href, css);
|
|
34
|
+
}
|
|
35
|
+
return manifest;
|
|
36
|
+
}
|
|
37
|
+
function createInlineCssManifestGlobalCode(manifest) {
|
|
38
|
+
return `${INLINE_CSS_GLOBAL_MARKER}${JSON.stringify(manifest)};`;
|
|
39
|
+
}
|
|
40
|
+
function injectInlineCssManifestGlobal(entryPath, manifest) {
|
|
41
|
+
if (Object.keys(manifest).length === 0 || !fs.existsSync(entryPath)) return false;
|
|
42
|
+
const code = fs.readFileSync(entryPath, "utf8");
|
|
43
|
+
if (code.includes(INLINE_CSS_GLOBAL_MARKER)) return false;
|
|
44
|
+
fs.writeFileSync(entryPath, `${createInlineCssManifestGlobalCode(manifest)}\n${code}`);
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { collectInlineCssManifest, injectInlineCssManifestGlobal };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=inline-css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-css.js","names":[],"sources":["../../src/build/inline-css.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { resolveAssetsDir, resolveAssetUrlPrefix } from \"../utils/asset-prefix.js\";\n\ntype InlineCssManifest = Record<string, string>;\n\nconst INLINE_CSS_GLOBAL_MARKER = \"globalThis.__VINEXT_INLINE_CSS__ = \";\n\nfunction collectCssFiles(directory: string): string[] {\n const files: string[] = [];\n\n for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {\n const filePath = path.join(directory, entry.name);\n if (entry.isDirectory()) {\n files.push(...collectCssFiles(filePath));\n } else if (entry.isFile() && entry.name.endsWith(\".css\")) {\n files.push(filePath);\n }\n }\n\n return files;\n}\n\nfunction toUrlPath(filePath: string): string {\n return filePath.split(path.sep).join(\"/\");\n}\n\nfunction addPathnameAlias(manifest: InlineCssManifest, href: string, css: string): void {\n try {\n const url = new URL(href);\n manifest[url.pathname] = css;\n } catch {\n // Relative asset URLs are already keyed by their emitted href.\n }\n}\n\nexport function collectInlineCssManifest(\n clientDir: string,\n assetPrefix: string,\n): InlineCssManifest {\n const assetsDir = path.join(clientDir, resolveAssetsDir(assetPrefix));\n if (!fs.existsSync(assetsDir)) return {};\n\n const urlPrefix = resolveAssetUrlPrefix(assetPrefix);\n const manifest: InlineCssManifest = {};\n\n for (const filePath of collectCssFiles(assetsDir)) {\n const relativePath = toUrlPath(path.relative(assetsDir, filePath));\n const href = `${urlPrefix}${relativePath}`;\n const css = fs.readFileSync(filePath, \"utf8\");\n manifest[href] = css;\n addPathnameAlias(manifest, href, css);\n }\n\n return manifest;\n}\n\nfunction createInlineCssManifestGlobalCode(manifest: InlineCssManifest): string {\n return `${INLINE_CSS_GLOBAL_MARKER}${JSON.stringify(manifest)};`;\n}\n\nexport function injectInlineCssManifestGlobal(\n entryPath: string,\n manifest: InlineCssManifest,\n): boolean {\n if (Object.keys(manifest).length === 0 || !fs.existsSync(entryPath)) return false;\n\n const code = fs.readFileSync(entryPath, \"utf8\");\n if (code.includes(INLINE_CSS_GLOBAL_MARKER)) return false;\n\n fs.writeFileSync(entryPath, `${createInlineCssManifestGlobalCode(manifest)}\\n${code}`);\n return true;\n}\n"],"mappings":";;;;AAMA,MAAM,2BAA2B;AAEjC,SAAS,gBAAgB,WAA6B;CACpD,MAAM,QAAkB,EAAE;CAE1B,KAAK,MAAM,SAAS,GAAG,YAAY,WAAW,EAAE,eAAe,MAAM,CAAC,EAAE;EACtE,MAAM,WAAW,KAAK,KAAK,WAAW,MAAM,KAAK;EACjD,IAAI,MAAM,aAAa,EACrB,MAAM,KAAK,GAAG,gBAAgB,SAAS,CAAC;OACnC,IAAI,MAAM,QAAQ,IAAI,MAAM,KAAK,SAAS,OAAO,EACtD,MAAM,KAAK,SAAS;;CAIxB,OAAO;;AAGT,SAAS,UAAU,UAA0B;CAC3C,OAAO,SAAS,MAAM,KAAK,IAAI,CAAC,KAAK,IAAI;;AAG3C,SAAS,iBAAiB,UAA6B,MAAc,KAAmB;CACtF,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,KAAK;EACzB,SAAS,IAAI,YAAY;SACnB;;AAKV,SAAgB,yBACd,WACA,aACmB;CACnB,MAAM,YAAY,KAAK,KAAK,WAAW,iBAAiB,YAAY,CAAC;CACrE,IAAI,CAAC,GAAG,WAAW,UAAU,EAAE,OAAO,EAAE;CAExC,MAAM,YAAY,sBAAsB,YAAY;CACpD,MAAM,WAA8B,EAAE;CAEtC,KAAK,MAAM,YAAY,gBAAgB,UAAU,EAAE;EAEjD,MAAM,OAAO,GAAG,YADK,UAAU,KAAK,SAAS,WAAW,SAAS,CACzB;EACxC,MAAM,MAAM,GAAG,aAAa,UAAU,OAAO;EAC7C,SAAS,QAAQ;EACjB,iBAAiB,UAAU,MAAM,IAAI;;CAGvC,OAAO;;AAGT,SAAS,kCAAkC,UAAqC;CAC9E,OAAO,GAAG,2BAA2B,KAAK,UAAU,SAAS,CAAC;;AAGhE,SAAgB,8BACd,WACA,UACS;CACT,IAAI,OAAO,KAAK,SAAS,CAAC,WAAW,KAAK,CAAC,GAAG,WAAW,UAAU,EAAE,OAAO;CAE5E,MAAM,OAAO,GAAG,aAAa,WAAW,OAAO;CAC/C,IAAI,KAAK,SAAS,yBAAyB,EAAE,OAAO;CAEpD,GAAG,cAAc,WAAW,GAAG,kCAAkC,SAAS,CAAC,IAAI,OAAO;CACtF,OAAO"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Route } from "../routing/pages-router.js";
|
|
2
2
|
import { AppRoute } from "../routing/app-route-graph.js";
|
|
3
3
|
import { ResolvedNextConfig } from "../config/next-config.js";
|
|
4
|
+
import { MetadataFileRoute } from "../server/metadata-routes.js";
|
|
4
5
|
import { readPrerenderSecret } from "./server-manifest.js";
|
|
5
6
|
import { Server } from "node:http";
|
|
6
7
|
|
|
7
8
|
//#region src/build/prerender.d.ts
|
|
8
9
|
type PrerenderResult = {
|
|
9
|
-
/** One entry per route (including skipped/error routes). */routes: PrerenderRouteResult[];
|
|
10
|
+
/** One entry per route (including skipped/error routes). */routes: PrerenderRouteResult[]; /** Additional generated files that are not represented as route entries. */
|
|
11
|
+
outputFiles?: string[];
|
|
10
12
|
};
|
|
11
13
|
type PrerenderRouteResult = {
|
|
12
14
|
/** The route's file-system pattern, e.g. `/blog/:slug`. */route: string;
|
|
@@ -83,7 +85,8 @@ type PrerenderPagesOptions = {
|
|
|
83
85
|
pagesBundlePath?: string;
|
|
84
86
|
} & PrerenderOptions;
|
|
85
87
|
type PrerenderAppOptions = {
|
|
86
|
-
/** Discovered app routes. */routes: AppRoute[];
|
|
88
|
+
/** Discovered app routes. */routes: AppRoute[]; /** Discovered file-based metadata routes. Used by static export. */
|
|
89
|
+
metadataRoutes?: readonly MetadataFileRoute[];
|
|
87
90
|
/**
|
|
88
91
|
* Absolute path to the pre-built RSC handler bundle (e.g. `dist/server/index.js`).
|
|
89
92
|
*/
|
|
@@ -176,6 +179,7 @@ declare function prerenderPages({
|
|
|
176
179
|
*/
|
|
177
180
|
declare function prerenderApp({
|
|
178
181
|
routes,
|
|
182
|
+
metadataRoutes,
|
|
179
183
|
outDir,
|
|
180
184
|
config,
|
|
181
185
|
mode,
|
package/dist/build/prerender.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { createValidFileMatcher, findFileWithExtensions } from "../routing/file-matcher.js";
|
|
2
|
-
import { VINEXT_PRERENDER_SECRET_HEADER } from "../server/headers.js";
|
|
2
|
+
import { VINEXT_PRERENDER_ROUTE_PARAMS_HEADER, VINEXT_PRERENDER_SECRET_HEADER } from "../server/headers.js";
|
|
3
3
|
import { normalizeStaticPathsEntry } from "../routing/route-pattern.js";
|
|
4
4
|
import { headersContextFromRequest, runWithHeadersContext } from "../shims/headers.js";
|
|
5
5
|
import { NoOpCacheHandler, _consumeRequestScopedCacheLife, getCacheHandler, setCacheHandler } from "../shims/cache.js";
|
|
6
6
|
import { classifyAppRoute, classifyPagesRoute, getAppRouteRenderEntryPath } from "./report.js";
|
|
7
|
+
import { BLOCKED_PAGES } from "../shims/constants.js";
|
|
7
8
|
import { concatUint8Arrays, decodeRscEmbeddedChunk } from "../server/app-rsc-embedded-chunks.js";
|
|
8
9
|
import { navigationRuntimeRscBootstrapExpression } from "../server/app-ssr-stream.js";
|
|
10
|
+
import { encodePrerenderRouteParams, serializePrerenderRouteParamsHeader } from "../server/prerender-route-params.js";
|
|
9
11
|
import { readPrerenderSecret } from "./server-manifest.js";
|
|
10
12
|
import { getOutputPath, getRscOutputPath } from "../utils/prerender-output-paths.js";
|
|
11
13
|
import { startProdServer } from "../server/prod-server.js";
|
|
@@ -143,6 +145,26 @@ function buildUrlFromParams(pattern, params) {
|
|
|
143
145
|
} else result.push(part);
|
|
144
146
|
return "/" + result.join("/");
|
|
145
147
|
}
|
|
148
|
+
function metadataOutputPath(servedUrl) {
|
|
149
|
+
const pathname = servedUrl.split("?", 1)[0];
|
|
150
|
+
if (!pathname || !pathname.startsWith("/")) return null;
|
|
151
|
+
const segments = pathname.split("/").filter(Boolean);
|
|
152
|
+
if (segments.length === 0 || segments.some((segment) => segment === "." || segment === "..")) return null;
|
|
153
|
+
return segments.join("/");
|
|
154
|
+
}
|
|
155
|
+
function emitStaticMetadataFiles(metadataRoutes, outDir) {
|
|
156
|
+
const outputFiles = [];
|
|
157
|
+
for (const route of metadataRoutes) {
|
|
158
|
+
if (route.isDynamic) continue;
|
|
159
|
+
const outputPath = metadataOutputPath(route.servedUrl);
|
|
160
|
+
if (!outputPath) continue;
|
|
161
|
+
const fullPath = path.join(outDir, ...outputPath.split("/"));
|
|
162
|
+
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
|
163
|
+
fs.copyFileSync(route.filePath, fullPath);
|
|
164
|
+
outputFiles.push(outputPath);
|
|
165
|
+
}
|
|
166
|
+
return outputFiles;
|
|
167
|
+
}
|
|
146
168
|
/**
|
|
147
169
|
* Resolve parent dynamic segment params for a route.
|
|
148
170
|
* Handles top-down generateStaticParams resolution for nested dynamic routes.
|
|
@@ -267,7 +289,8 @@ async function prerenderPages({ routes, apiRoutes, pagesDir, outDir, config, mod
|
|
|
267
289
|
}));
|
|
268
290
|
const pagesToRender = [];
|
|
269
291
|
for (const route of bundlePageRoutes) {
|
|
270
|
-
if (
|
|
292
|
+
if (BLOCKED_PAGES.includes(route.pattern)) continue;
|
|
293
|
+
if (route.pattern === "/404") continue;
|
|
271
294
|
if (!routes.find((r) => r.filePath === route.filePath || r.pattern === route.pattern)) continue;
|
|
272
295
|
const { type, revalidate: classifiedRevalidate } = classifyPagesRoute(route.filePath);
|
|
273
296
|
if (type === "ssr") {
|
|
@@ -394,9 +417,12 @@ async function prerenderPages({ routes, apiRoutes, pagesDir, outDir, config, mod
|
|
|
394
417
|
return result;
|
|
395
418
|
});
|
|
396
419
|
results.push(...pageResults);
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
420
|
+
const hasCustom404 = findFileWithExtensions(path.join(pagesDir, "404"), fileMatcher);
|
|
421
|
+
const hasErrorPage = findFileWithExtensions(path.join(pagesDir, "_error"), fileMatcher);
|
|
422
|
+
if (hasCustom404 || hasErrorPage) try {
|
|
423
|
+
const notFoundRes = await renderPage(hasCustom404 ? "/404" : NOT_FOUND_SENTINEL_PATH);
|
|
424
|
+
const contentType = notFoundRes.headers.get("content-type") ?? "";
|
|
425
|
+
if (notFoundRes.status === 404 && contentType.includes("text/html")) {
|
|
400
426
|
const html404 = await notFoundRes.text();
|
|
401
427
|
const fullPath = path.join(outDir, "404.html");
|
|
402
428
|
fs.writeFileSync(fullPath, html404, "utf-8");
|
|
@@ -438,7 +464,7 @@ async function prerenderPages({ routes, apiRoutes, pagesDir, outDir, config, mod
|
|
|
438
464
|
* If they succeed, they are marked as rendered. If they throw a DynamicUsageError
|
|
439
465
|
* or fail, they are marked as skipped with reason 'dynamic'.
|
|
440
466
|
*/
|
|
441
|
-
async function prerenderApp({ routes, outDir, config, mode, rscBundlePath, ...options }) {
|
|
467
|
+
async function prerenderApp({ routes, metadataRoutes = [], outDir, config, mode, rscBundlePath, ...options }) {
|
|
442
468
|
const manifestDir = options.manifestDir ?? outDir;
|
|
443
469
|
const concurrency = options.concurrency ?? DEFAULT_CONCURRENCY;
|
|
444
470
|
const onProgress = options.onProgress;
|
|
@@ -477,7 +503,8 @@ async function prerenderApp({ routes, outDir, config, mode, rscBundlePath, ...op
|
|
|
477
503
|
...secretHeaders,
|
|
478
504
|
...Object.fromEntries(req.headers.entries())
|
|
479
505
|
},
|
|
480
|
-
body: req.method !== "GET" && req.method !== "HEAD" ? req.body : void 0
|
|
506
|
+
body: req.method !== "GET" && req.method !== "HEAD" ? req.body : void 0,
|
|
507
|
+
redirect: "manual"
|
|
481
508
|
});
|
|
482
509
|
};
|
|
483
510
|
const staticParamsCache = /* @__PURE__ */ new Map();
|
|
@@ -608,6 +635,7 @@ async function prerenderApp({ routes, outDir, config, mode, rscBundlePath, ...op
|
|
|
608
635
|
urlsToRender.push({
|
|
609
636
|
urlPath,
|
|
610
637
|
routePattern: route.pattern,
|
|
638
|
+
prerenderRouteParams: encodePrerenderRouteParams(route.pattern, params),
|
|
611
639
|
revalidate,
|
|
612
640
|
isSpeculative: false
|
|
613
641
|
});
|
|
@@ -624,12 +652,14 @@ async function prerenderApp({ routes, outDir, config, mode, rscBundlePath, ...op
|
|
|
624
652
|
else if (type === "unknown") urlsToRender.push({
|
|
625
653
|
urlPath: route.pattern,
|
|
626
654
|
routePattern: route.pattern,
|
|
655
|
+
prerenderRouteParams: null,
|
|
627
656
|
revalidate: false,
|
|
628
657
|
isSpeculative: true
|
|
629
658
|
});
|
|
630
659
|
else urlsToRender.push({
|
|
631
660
|
urlPath: route.pattern,
|
|
632
661
|
routePattern: route.pattern,
|
|
662
|
+
prerenderRouteParams: null,
|
|
633
663
|
revalidate,
|
|
634
664
|
isSpeculative: false
|
|
635
665
|
});
|
|
@@ -640,9 +670,12 @@ async function prerenderApp({ routes, outDir, config, mode, rscBundlePath, ...op
|
|
|
640
670
|
* exactly once per URL after this function returns, keeping the callback
|
|
641
671
|
* at a single, predictable call site.
|
|
642
672
|
*/
|
|
643
|
-
async function renderUrl({ urlPath, routePattern, revalidate, isSpeculative }) {
|
|
673
|
+
async function renderUrl({ urlPath, routePattern, prerenderRouteParams, revalidate, isSpeculative }) {
|
|
644
674
|
try {
|
|
645
|
-
const
|
|
675
|
+
const prerenderRouteParamsHeader = serializePrerenderRouteParamsHeader(prerenderRouteParams);
|
|
676
|
+
const htmlHeaders = new Headers();
|
|
677
|
+
if (prerenderRouteParamsHeader !== null) htmlHeaders.set(VINEXT_PRERENDER_ROUTE_PARAMS_HEADER, prerenderRouteParamsHeader);
|
|
678
|
+
const htmlRequest = new Request(`http://localhost${urlPath}`, { headers: htmlHeaders });
|
|
646
679
|
const htmlRender = await runWithHeadersContext(headersContextFromRequest(htmlRequest), async () => {
|
|
647
680
|
const response = await rscHandler(htmlRequest);
|
|
648
681
|
const cacheControl = response.headers.get("cache-control") ?? "";
|
|
@@ -692,10 +725,12 @@ async function prerenderApp({ routes, outDir, config, mode, rscBundlePath, ...op
|
|
|
692
725
|
const html = htmlRender.html;
|
|
693
726
|
let rscData = extractRscPayloadFromPrerenderedHtml(html);
|
|
694
727
|
if (rscData === null) {
|
|
695
|
-
const
|
|
728
|
+
const rscHeaders = new Headers({
|
|
696
729
|
Accept: "text/x-component",
|
|
697
730
|
RSC: "1"
|
|
698
|
-
}
|
|
731
|
+
});
|
|
732
|
+
if (prerenderRouteParamsHeader !== null) rscHeaders.set(VINEXT_PRERENDER_ROUTE_PARAMS_HEADER, prerenderRouteParamsHeader);
|
|
733
|
+
const rscRequest = new Request(`http://localhost${urlPath}`, { headers: rscHeaders });
|
|
699
734
|
const rscRes = await runWithHeadersContext(headersContextFromRequest(rscRequest), () => rscHandler(rscRequest));
|
|
700
735
|
if (!rscRes.ok) {
|
|
701
736
|
await rscRes.body?.cancel();
|
|
@@ -752,6 +787,7 @@ async function prerenderApp({ routes, outDir, config, mode, rscBundlePath, ...op
|
|
|
752
787
|
return result;
|
|
753
788
|
});
|
|
754
789
|
results.push(...appResults);
|
|
790
|
+
const outputFiles = mode === "export" && metadataRoutes.length > 0 ? emitStaticMetadataFiles(metadataRoutes, outDir) : [];
|
|
755
791
|
try {
|
|
756
792
|
const notFoundRequest = new Request(`http://localhost${NOT_FOUND_SENTINEL_PATH}`);
|
|
757
793
|
const notFoundRes = await runWithHeadersContext(headersContextFromRequest(notFoundRequest), () => rscHandler(notFoundRequest));
|
|
@@ -773,7 +809,10 @@ async function prerenderApp({ routes, outDir, config, mode, rscBundlePath, ...op
|
|
|
773
809
|
buildId: config.buildId,
|
|
774
810
|
trailingSlash: config.trailingSlash
|
|
775
811
|
});
|
|
776
|
-
return {
|
|
812
|
+
return {
|
|
813
|
+
routes: results,
|
|
814
|
+
...outputFiles.length > 0 ? { outputFiles } : {}
|
|
815
|
+
};
|
|
777
816
|
} finally {
|
|
778
817
|
setCacheHandler(previousHandler);
|
|
779
818
|
if (previousPrerenderFlag === void 0) delete process.env.VINEXT_PRERENDER;
|