Skip to content

Commit

Permalink
fix: mark async_hooks as external
Browse files Browse the repository at this point in the history
  • Loading branch information
james-elicx committed Nov 27, 2024
1 parent 96c331d commit 1d76983
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/stupid-dragons-brake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cloudflare/next-on-pages': patch
---

Mark `async_hooks` as external.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ export async function buildWorkerFile(
banner: { js: generateGlobalJs() },
bundle: true,
inject: [functionsFile],
external: ['node:*', './__next-on-pages-dist__/*', 'cloudflare:*'],
external: [
'node:*',
'async_hooks',
'./__next-on-pages-dist__/*',
'cloudflare:*',
],
define: {
__CONFIG__: JSON.stringify(vercelConfig),
__NODE_ENV__: JSON.stringify(getNodeEnv()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,13 @@ export async function buildFile(
platform: 'neutral',
outfile: filePath,
bundle: true,
external: ['node:*', `${relativeNopDistPath}/*`, '*.wasm', 'cloudflare:*'],
external: [
'node:*',
'async_hooks',
`${relativeNopDistPath}/*`,
'*.wasm',
'cloudflare:*',
],
minify: true,
plugins: [builtInModulesPlugin],
define: {
Expand Down

0 comments on commit 1d76983

Please sign in to comment.