File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,25 @@ const NODE_BUILTIN_NAMESPACE = 'node:'
9494const NPM_BUILTIN_NAMESPACE = 'npm:'
9595// Supported by Bun
9696const BUN_BUILTIN_NAMESPACE = 'bun:'
97+ //TODO: revisit later to see if the edge case that "compiling using node v12 code to be run in node v16 in the server" is what we intend to support.
98+ const builtins = new Set ( [
99+ ...builtinModules ,
100+ 'assert/strict' ,
101+ 'diagnostics_channel' ,
102+ 'dns/promises' ,
103+ 'fs/promises' ,
104+ 'path/posix' ,
105+ 'path/win32' ,
106+ 'readline/promises' ,
107+ 'stream/consumers' ,
108+ 'stream/promises' ,
109+ 'stream/web' ,
110+ 'timers/promises' ,
111+ 'util/types' ,
112+ 'wasi' ,
113+ ] )
97114// Some runtimes like Bun injects namespaced modules here, which is not a node builtin
98- const nodeBuiltins = builtinModules . filter ( ( id ) => ! id . includes ( ':' ) )
115+ const nodeBuiltins = [ ... builtins ] . filter ( ( id ) => ! id . includes ( ':' ) )
99116
100117// TODO: Use `isBuiltin` from `node:module`, but Deno doesn't support it
101118export function isBuiltin ( id : string ) : boolean {
You can’t perform that action at this time.
0 commit comments