File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -376,15 +376,16 @@ export function createRepl(options: CreateReplOptions = {}) {
376
376
// Declare node builtins.
377
377
// Skip the same builtins as `addBuiltinLibsToObject`:
378
378
// those starting with _
379
- // those containing /
379
+ // those containing / or :
380
380
// those that already exist as globals
381
381
// Intentionally suppress type errors in case @types /node does not declare any of them, and because
382
382
// `declare import` is technically invalid syntax.
383
383
// Avoid this when in transpileOnly, because third-party transpilers may not handle `declare import`.
384
384
if ( ! service ?. transpileOnly ) {
385
385
state . input += `// @ts-ignore\n${ builtinModules
386
386
. filter (
387
- ( name ) => ! name . startsWith ( '_' ) && ! name . includes ( '/' ) && ! [ 'console' , 'module' , 'process' ] . includes ( name )
387
+ ( name ) => ( ! name . startsWith ( '_' ) && ! name . includes ( '/' ) && ! name . includes ( ':' )
388
+ && ! [ 'console' , 'module' , 'process' ] . includes ( name ) )
388
389
)
389
390
. map ( ( name ) => `declare import ${ name } = require('${ name } ')` )
390
391
. join ( ';' ) } \n`;
You can’t perform that action at this time.
0 commit comments