File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -557,15 +557,21 @@ Module.prototype.load = function(filename) {
557
557
if ( ESMLoader ) {
558
558
const url = getURLFromFilePath ( filename ) ;
559
559
const urlString = `${ url } ` ;
560
+ const exports = this . exports ;
560
561
if ( ESMLoader . moduleMap . has ( urlString ) !== true ) {
561
- const ctx = createDynamicModule ( [ 'default' ] , url ) ;
562
- ctx . reflect . exports . default . set ( this . exports ) ;
563
- ESMLoader . moduleMap . set ( urlString ,
564
- new ModuleJob ( ESMLoader , url , async ( ) => ctx ) ) ;
562
+ ESMLoader . moduleMap . set (
563
+ urlString ,
564
+ new ModuleJob ( ESMLoader , url , async ( ) => {
565
+ const ctx = createDynamicModule (
566
+ [ 'default' ] , url ) ;
567
+ ctx . reflect . exports . default . set ( exports ) ;
568
+ return ctx ;
569
+ } )
570
+ ) ;
565
571
} else {
566
572
const job = ESMLoader . moduleMap . get ( urlString ) ;
567
573
if ( job . reflect )
568
- job . reflect . exports . default . set ( this . exports ) ;
574
+ job . reflect . exports . default . set ( exports ) ;
569
575
}
570
576
}
571
577
} ;
You can’t perform that action at this time.
0 commit comments