@@ -53,25 +53,33 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
5353 } ;
5454 }
5555
56- const isNotAHarmonyModule =
57- importedModule . buildMeta && ! importedModule . buildMeta . exportsType ;
5856 const strictHarmonyModule = this . originModule . buildMeta . strictHarmonyModule ;
59- if ( name && id === "default" && isNotAHarmonyModule ) {
60- if ( strictHarmonyModule ) {
61- return {
62- type : "reexport-non-harmony-default-strict" ,
63- module : importedModule ,
64- name
65- } ;
66- } else {
57+ if ( name && id === "default" && importedModule . buildMeta ) {
58+ if ( ! importedModule . buildMeta . exportsType ) {
59+ if ( strictHarmonyModule ) {
60+ return {
61+ type : "reexport-non-harmony-default-strict" ,
62+ module : importedModule ,
63+ name
64+ } ;
65+ } else {
66+ return {
67+ type : "reexport-non-harmony-default" ,
68+ module : importedModule ,
69+ name
70+ } ;
71+ }
72+ } else if ( importedModule . buildMeta . exportsType === "named" ) {
6773 return {
68- type : "reexport-non-harmony -default" ,
74+ type : "reexport-named -default" ,
6975 module : importedModule ,
7076 name
7177 } ;
7278 }
7379 }
7480
81+ const isNotAHarmonyModule =
82+ importedModule . buildMeta && ! importedModule . buildMeta . exportsType ;
7583 if ( name ) {
7684 // export { name as name }
7785 if ( id ) {
@@ -209,6 +217,7 @@ class HarmonyExportImportedSpecifierDependency extends HarmonyImportDependency {
209217 return null ;
210218
211219 case "reexport-non-harmony-default" :
220+ case "reexport-named-default" :
212221 return {
213222 module : mode . module ,
214223 importedNames : [ "default" ]
@@ -459,6 +468,17 @@ HarmonyExportImportedSpecifierDependency.Template = class HarmonyExportImportedS
459468 )
460469 ) ;
461470
471+ case "reexport-named-default" :
472+ return (
473+ "/* harmony reexport (default from named exports) */ " +
474+ this . getReexportStatement (
475+ module ,
476+ module . isUsed ( mode . name ) ,
477+ importVar ,
478+ ""
479+ )
480+ ) ;
481+
462482 case "reexport-fake-namespace-object" :
463483 return (
464484 "/* harmony reexport (fake namespace object from non-harmony) */ " +
0 commit comments