Skip to content

Commit 0bc155e

Browse files
authored
Support a curated list of node modules
1 parent ed65c77 commit 0bc155e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/adapter-cloudflare/index.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@ export default function (options = {}) {
5353
}
5454
});
5555

56+
const nodeModules = [
57+
'node:assert',
58+
'node:async_hooks',
59+
'node:buffer',
60+
'node:crypto',
61+
'node:diagnostics_channel',
62+
'node:events',
63+
'node:path',
64+
'node:process',
65+
'node:stream',
66+
'node:string_decoder',
67+
'node:util'
68+
];
69+
5670
await esbuild.build({
5771
platform: 'browser',
5872
conditions: ['worker', 'browser'],
@@ -66,7 +80,7 @@ export default function (options = {}) {
6680
loader: {
6781
'.wasm': 'copy'
6882
},
69-
external: ['cloudflare:*', 'node:*']
83+
external: ['cloudflare:*', ...nodeModules]
7084
});
7185
}
7286
};

0 commit comments

Comments
 (0)