@@ -351,7 +351,11 @@ export default class Module {
351351 if ( name !== 'default' ) allExportNames . add ( name ) ;
352352 }
353353 }
354-
354+ // We do not count the synthetic namespace as a regular export to hide it
355+ // from entry signatures and namespace objects
356+ if ( typeof this . info . syntheticNamedExports === 'string' ) {
357+ allExportNames . delete ( this . info . syntheticNamedExports ) ;
358+ }
355359 return allExportNames ;
356360 }
357361
@@ -412,7 +416,6 @@ export default class Module {
412416 }
413417 const exportNamesByVariable = new Map < Variable , string [ ] > ( ) ;
414418 for ( const exportName of this . getAllExportNames ( ) ) {
415- if ( exportName === this . info . syntheticNamedExports ) continue ;
416419 let [ tracedVariable ] = this . getVariableForExportName ( exportName ) ;
417420 if ( tracedVariable instanceof ExportDefaultVariable ) {
418421 tracedVariable = tracedVariable . getOriginalVariable ( ) ;
@@ -477,7 +480,8 @@ export default class Module {
477480 [ this . syntheticNamespace ] = this . getVariableForExportName (
478481 typeof this . info . syntheticNamedExports === 'string'
479482 ? this . info . syntheticNamedExports
480- : 'default'
483+ : 'default' ,
484+ { onlyExplicit : true }
481485 ) ;
482486 }
483487 if ( ! this . syntheticNamespace ) {
@@ -493,10 +497,12 @@ export default class Module {
493497 {
494498 importerForSideEffects,
495499 isExportAllSearch,
500+ onlyExplicit,
496501 searchedNamesAndModules
497502 } : {
498503 importerForSideEffects ?: Module ;
499504 isExportAllSearch ?: boolean ;
505+ onlyExplicit ?: boolean ;
500506 searchedNamesAndModules ?: Map < string , Set < Module | ExternalModule > > ;
501507 } = EMPTY_OBJECT
502508 ) : [ variable : Variable | null , indirectExternal ?: boolean ] {
@@ -521,7 +527,6 @@ export default class Module {
521527 false ,
522528 searchedNamesAndModules
523529 ) ;
524-
525530 if ( ! variable ) {
526531 return this . error (
527532 errMissingExport ( reexportDeclaration . localName , this . id , reexportDeclaration . module . id ) ,
@@ -552,6 +557,10 @@ export default class Module {
552557 return [ variable ] ;
553558 }
554559
560+ if ( onlyExplicit ) {
561+ return [ null ] ;
562+ }
563+
555564 if ( name !== 'default' ) {
556565 const foundNamespaceReexport =
557566 name in this . namespaceReexportsByName
@@ -1021,6 +1030,10 @@ export default class Module {
10211030 const foundInternalDeclarations = new Map < Variable , Module > ( ) ;
10221031 const foundExternalDeclarations = new Set < ExternalVariable > ( ) ;
10231032 for ( const module of this . exportAllModules ) {
1033+ // Synthetic namespaces should not hide "regular" exports of the same name
1034+ if ( module . info . syntheticNamedExports === name ) {
1035+ continue ;
1036+ }
10241037 const [ variable , indirectExternal ] = getVariableForExportNameRecursive (
10251038 module ,
10261039 name ,
0 commit comments