Skip to content

Commit 60c7f62

Browse files
committed
fixup! add comments, rename
1 parent c4586a1 commit 60c7f62

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

packages/cloudflare/src/cli/build/open-next/createServerBundle.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import type { Plugin } from "esbuild";
2727

2828
import { getOpenNextConfig } from "../../../api/config.js";
2929
import { patchResRevalidate } from "../patches/plugins/res-revalidate.js";
30-
import { inlineChunksPatch } from "../patches/plugins/turbopack.js";
30+
import { patchTurbopackRuntime } from "../patches/plugins/turbopack.js";
3131
import { patchUseCacheIO } from "../patches/plugins/use-cache.js";
3232
import { normalizePath } from "../utils/index.js";
3333
import { copyWorkerdPackages } from "../utils/workerd.js";
@@ -211,7 +211,7 @@ async function generateBundle(
211211
// Cloudflare specific patches
212212
patchResRevalidate,
213213
patchUseCacheIO,
214-
inlineChunksPatch,
214+
patchTurbopackRuntime,
215215
...additionalCodePatches,
216216
]);
217217

packages/cloudflare/src/cli/build/patches/plugins/turbopack.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fix:
1010
requireChunk(chunkPath)
1111
`;
1212

13-
export const inlineChunksPatch: CodePatcher = {
13+
export const patchTurbopackRuntime: CodePatcher = {
1414
name: "inline-turbopack-chunks",
1515
patches: [
1616
{
@@ -64,6 +64,10 @@ ${chunks
6464
`;
6565
}
6666

67+
// Turbopack imports `og` via `externalImport`.
68+
// We patch it to:
69+
// - add the explicit path so that the file is inlined by wrangler
70+
// - use the edge version of the module instead of the node version.
6771
const inlineExternalImportRule = `
6872
rule:
6973
pattern: "$RAW = await import($ID)"

0 commit comments

Comments
 (0)