this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make the require patch optional (#713)

authored by

Victor Berchet and committed by
GitHub
3d8fb0c3 5f197fc3

+8 -4
+5
.changeset/whole-spiders-stay.md
··· 1 + --- 2 + "@opennextjs/cloudflare": patch 3 + --- 4 + 5 + make the "require" patch optional
+3 -1
packages/cloudflare/src/cli/build/bundle-server.ts
··· 174 174 */ 175 175 export async function updateWorkerBundledCode(workerOutputFile: string): Promise<void> { 176 176 const code = await readFile(workerOutputFile, "utf8"); 177 - const patchedCode = await patchCodeWithValidations(code, [["require", patches.patchRequire]]); 177 + const patchedCode = await patchCodeWithValidations(code, [ 178 + ["require", patches.patchRequire, { isOptional: true }], 179 + ]); 178 180 await writeFile(workerOutputFile, patchedCode); 179 181 } 180 182
-2
packages/cloudflare/src/cli/build/patches/plugins/open-next.ts
··· 19 19 path.join(outputPath, packagePath, `index.mjs`) 20 20 ); 21 21 22 - console.error({ index: indexPath }); 23 - 24 22 return updater.updateContent("patch-resolve-cache", [ 25 23 { 26 24 field: {
-1
packages/cloudflare/src/cli/build/utils/apply-patches.ts
··· 25 25 } 26 26 } 27 27 28 - console.log(`All ${patches.length} patches applied\n`); 29 28 return patchedCode; 30 29 }