Skip to content

Commit 79305a1

Browse files
committed
patch manifest
1 parent 040731c commit 79305a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/cloudflare/src/cli/build/patches/plugins/load-manifest.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ async function getLoadManifestRule(buildOpts: BuildOptions) {
3939
const baseDir = join(outputDir, "server-functions/default", getPackagePath(buildOpts));
4040
const dotNextDir = join(baseDir, ".next");
4141

42-
const manifests = await glob(join(dotNextDir, "**/*-manifest.json"), { windowsPathsNoEscape: true });
42+
const manifests = await glob(join(dotNextDir, "**/{*-manifest,required-server-files}.json"), {
43+
windowsPathsNoEscape: true,
44+
});
4345

4446
const returnManifests = (
4547
await Promise.all(
@@ -61,6 +63,9 @@ function loadManifest($PATH, $$$ARGS) {
6163
},
6264
fix: `
6365
function loadManifest($PATH, $$$ARGS) {
66+
if ($PATH === "/.next/BUILD_ID") {
67+
return process.env.__NEXT_BUILD_ID;
68+
}
6469
$PATH = $PATH.replaceAll(${JSON.stringify(sep)}, ${JSON.stringify(posix.sep)});
6570
${returnManifests}
6671
throw new Error(\`Unexpected loadManifest(\${$PATH}) call!\`);

0 commit comments

Comments
 (0)