diff --git a/.changeset/sweet-chairs-explode.md b/.changeset/sweet-chairs-explode.md new file mode 100644 index 000000000..6bdc42703 --- /dev/null +++ b/.changeset/sweet-chairs-explode.md @@ -0,0 +1,5 @@ +--- +'@cloudflare/next-on-pages': patch +--- + +Allow import of `node:*` and `cloudflare:*` in worker custom entrypoint diff --git a/packages/next-on-pages/src/buildApplication/buildWorkerFile.ts b/packages/next-on-pages/src/buildApplication/buildWorkerFile.ts index 2d01843cd..076a4d9ca 100644 --- a/packages/next-on-pages/src/buildApplication/buildWorkerFile.ts +++ b/packages/next-on-pages/src/buildApplication/buildWorkerFile.ts @@ -109,6 +109,7 @@ export async function buildWorkerFile( outfile: outputFile, allowOverwrite: true, bundle: true, + external: ['node:*', 'cloudflare:*'], plugins: [ { name: 'custom-entrypoint-import-plugin',