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 @@ -572,15 +572,21 @@ Module.prototype.load = function(filename) {
572
572
if ( ESMLoader ) {
573
573
const url = getURLFromFilePath ( filename ) ;
574
574
const urlString = `${ url } ` ;
575
+ const exports = this . exports ;
575
576
if ( ESMLoader . moduleMap . has ( urlString ) !== true ) {
576
- const ctx = createDynamicModule ( [ 'default' ] , url ) ;
577
- ctx . reflect . exports . default . set ( this . exports ) ;
578
- ESMLoader . moduleMap . set ( urlString ,
579
- new ModuleJob ( ESMLoader , url , async ( ) => ctx ) ) ;
577
+ ESMLoader . moduleMap . set (
578
+ urlString ,
579
+ new ModuleJob ( ESMLoader , url , async ( ) => {
580
+ const ctx = createDynamicModule (
581
+ [ 'default' ] , url ) ;
582
+ ctx . reflect . exports . default . set ( exports ) ;
583
+ return ctx ;
584
+ } )
585
+ ) ;
580
586
} else {
581
587
const job = ESMLoader . moduleMap . get ( urlString ) ;
582
588
if ( job . reflect )
583
- job . reflect . exports . default . set ( this . exports ) ;
589
+ job . reflect . exports . default . set ( exports ) ;
584
590
}
585
591
}
586
592
} ;
You can’t perform that action at this time.
0 commit comments