@opennextjs/cloudflare 1.17.1 → 1.17.3
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.
|
@@ -29,7 +29,7 @@ async function getLoadManifestRule(buildOpts) {
|
|
|
29
29
|
const { outputDir } = buildOpts;
|
|
30
30
|
const baseDir = join(outputDir, "server-functions/default", getPackagePath(buildOpts));
|
|
31
31
|
const dotNextDir = join(baseDir, ".next");
|
|
32
|
-
const manifests = await glob(join(dotNextDir, "**/{*-manifest,required-server-files}.json"), {
|
|
32
|
+
const manifests = await glob(join(dotNextDir, "**/{*-manifest,required-server-files,prefetch-hints}.json"), {
|
|
33
33
|
windowsPathsNoEscape: true,
|
|
34
34
|
});
|
|
35
35
|
const returnManifests = (await Promise.all(manifests.map(async (manifest) => `
|
|
@@ -50,6 +50,23 @@ function loadManifest($PATH, $$$ARGS) {
|
|
|
50
50
|
return process.env.NEXT_BUILD_ID;
|
|
51
51
|
}
|
|
52
52
|
${returnManifests}
|
|
53
|
+
// Known optional manifests \u2014 Next.js loads these with handleMissing: true
|
|
54
|
+
// (see vercel/next.js packages/next/src/server/route-modules/route-module.ts).
|
|
55
|
+
// Return {} to match Next.js behaviour instead of crashing the worker.
|
|
56
|
+
// Note: Some manifest constants in Next.js omit the .json extension
|
|
57
|
+
// (e.g. SUBRESOURCE_INTEGRITY_MANIFEST, DYNAMIC_CSS_MANIFEST), so we
|
|
58
|
+
// strip .json before matching to handle both forms.
|
|
59
|
+
{
|
|
60
|
+
const p = $PATH.replace(/\\.json$/, "");
|
|
61
|
+
if (p.endsWith("react-loadable-manifest") ||
|
|
62
|
+
p.endsWith("subresource-integrity-manifest") ||
|
|
63
|
+
p.endsWith("server-reference-manifest") ||
|
|
64
|
+
p.endsWith("dynamic-css-manifest") ||
|
|
65
|
+
p.endsWith("fallback-build-manifest") ||
|
|
66
|
+
p.endsWith("prefetch-hints")) {
|
|
67
|
+
return {};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
53
70
|
throw new Error(\`Unexpected loadManifest(\${$PATH}) call!\`);
|
|
54
71
|
}`,
|
|
55
72
|
};
|
|
@@ -87,6 +104,11 @@ function evalManifest($PATH, $$$ARGS) {
|
|
|
87
104
|
function evalManifest($PATH, $$$ARGS) {
|
|
88
105
|
$PATH = $PATH.replaceAll(${JSON.stringify(sep)}, ${JSON.stringify(posix.sep)});
|
|
89
106
|
${returnManifests}
|
|
107
|
+
// client-reference-manifest is optional for static metadata routes
|
|
108
|
+
// (see vercel/next.js route-module.ts, loaded with handleMissing: true)
|
|
109
|
+
if ($PATH.endsWith("_client-reference-manifest.js")) {
|
|
110
|
+
return { __RSC_MANIFEST: {} };
|
|
111
|
+
}
|
|
90
112
|
throw new Error(\`Unexpected evalManifest(\${$PATH}) call!\`);
|
|
91
113
|
}`,
|
|
92
114
|
};
|