Commit dfad8f5 1 parent 5a15e7a commit dfad8f5 Copy full SHA for dfad8f5
File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -58,23 +58,23 @@ async function initializeLoader() {
58
58
const { getOptionValue } = require ( 'internal/options' ) ;
59
59
const customLoaders = getOptionValue ( '--experimental-loader' ) ;
60
60
const preloadModules = getOptionValue ( '--experimental-import' ) ;
61
- const keyedExportsList = await loadInternalModules ( customLoaders ) ;
61
+ const keyedExportsList = await loadModulesInIsolation ( customLoaders ) ;
62
62
63
63
// Hooks must then be added to external/public loader
64
64
// (so they're triggered in userland)
65
+ // TODO(@JakobJingleheimer) this should be synchronous
65
66
await esmLoader . addCustomLoaders ( keyedExportsList ) ;
66
67
67
68
// Preload after loaders are added so they can be used
68
69
if ( preloadModules ?. length ) {
69
- await loadInternalModules ( preloadModules ) ;
70
+ await loadModulesInIsolation ( preloadModules ) ;
70
71
}
71
72
72
73
isESMInitialized = true ;
73
74
}
74
75
75
- async function loadInternalModules ( requests ) {
76
- if ( ! ArrayIsArray ( requests ) || requests . length === 0 )
77
- return ;
76
+ async function loadModulesInIsolation ( specifiers ) {
77
+ if ( ! ArrayIsArray ( specifiers ) || specifiers . length === 0 ) return ;
78
78
79
79
let cwd ;
80
80
try {
@@ -90,7 +90,7 @@ async function loadInternalModules(requests) {
90
90
91
91
// Importation must be handled by internal loader to avoid poluting userland
92
92
return internalEsmLoader . import (
93
- requests ,
93
+ specifiers ,
94
94
pathToFileURL ( cwd ) . href ,
95
95
ObjectCreate ( null ) ,
96
96
) ;
You can’t perform that action at this time.
0 commit comments