@@ -1458,6 +1458,16 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
14581458 concatenationScope
14591459 ) . createModuleReference ( importedModule , { asiSafe : true } )
14601460 : dep . getImportVar ( moduleGraph ) ;
1461+
1462+ const defaultImportVar = inScope
1463+ ? /** @type {ConcatenationScope } */ (
1464+ concatenationScope
1465+ ) . createModuleReference ( importedModule , {
1466+ ids : [ "default" ] ,
1467+ asiSafe : true
1468+ } )
1469+ : dep . getImportVar ( moduleGraph ) ;
1470+
14611471 // whole-namespace modes need the original export names, not mangled ones
14621472 const namespaceImportVar = inScope
14631473 ? /** @type {ConcatenationScope } */ (
@@ -1520,25 +1530,14 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
15201530 break ;
15211531
15221532 case "reexport-dynamic-default" : {
1523- // `${importVar}_default` names the interop variable that the import
1524- // statement declares. An in-scope target has no import statement, so
1525- // reference its default export and let the concatenation resolve it.
1526- const defaultAccess = inScope
1527- ? /** @type {ConcatenationScope } */ (
1528- concatenationScope
1529- ) . createModuleReference ( importedModule , {
1530- ids : [ "default" ] ,
1531- asiSafe : true
1532- } )
1533- : importVar ;
15341533 initFragments . push (
15351534 this . getReexportFragment (
15361535 module ,
15371536 "reexport default from dynamic" ,
15381537 moduleGraph
15391538 . getExportsInfo ( module )
15401539 . getUsedName ( /** @type {string } */ ( mode . name ) , runtime ) ,
1541- defaultAccess ,
1540+ defaultImportVar ,
15421541 inScope ? "" : null ,
15431542 runtimeRequirements
15441543 )
@@ -1605,7 +1604,7 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
16051604 moduleGraph
16061605 . getExportsInfo ( module )
16071606 . getUsedName ( /** @type {string } */ ( mode . name ) , runtime ) ,
1608- importVar ,
1607+ defaultImportVar ,
16091608 "" ,
16101609 runtimeRequirements
16111610 )
0 commit comments