File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
packages/cloudflare/src/cli/build Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ import type { Plugin } from "esbuild";
2727
2828import { getOpenNextConfig } from "../../../api/config.js" ;
2929import { patchResRevalidate } from "../patches/plugins/res-revalidate.js" ;
30- import { inlineChunksPatch } from "../patches/plugins/turbopack.js" ;
30+ import { patchTurbopackRuntime } from "../patches/plugins/turbopack.js" ;
3131import { patchUseCacheIO } from "../patches/plugins/use-cache.js" ;
3232import { normalizePath } from "../utils/index.js" ;
3333import { 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
Original file line number Diff line number Diff line change 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.
6771const inlineExternalImportRule = `
6872rule:
6973 pattern: "$RAW = await import($ID)"
You can’t perform that action at this time.
0 commit comments