File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -542,12 +542,19 @@ export function rewriteModule(code, moduleName) {
542
542
543
543
// Remove `declare` from `declare function` in the top-level module.
544
544
visitTSDeclareFunction ( path ) {
545
- if ( isTSDeclareFunction ( path . node ) && ! hasParentModuleDeclarationBlock ( path ) ) {
545
+ if ( ! hasParentModuleDeclarationBlock ( path ) ) {
546
546
path . node . declare = false ;
547
547
}
548
548
this . traverse ( path ) ;
549
549
} ,
550
550
551
+ visitTSInterfaceDeclaration ( path ) {
552
+ if ( ! hasParentModuleDeclarationBlock ( path ) ) {
553
+ path . node . declare = false ;
554
+ }
555
+ this . traverse ( false ) ;
556
+ } ,
557
+
551
558
// Remove `declare` from `declare enum` in the top-level module.
552
559
visitTSEnumDeclaration ( path ) {
553
560
if ( isTSEnumDeclaration ( path . node ) && ! hasParentModuleDeclarationBlock ( path ) ) {
@@ -584,6 +591,14 @@ export function rewriteModule(code, moduleName) {
584
591
this . traverse ( path ) ;
585
592
} ,
586
593
594
+ visitExportAllDeclaration ( path ) {
595
+ let specifier = path . node . source ;
596
+ if ( isStringLiteral ( specifier ) ) {
597
+ specifier . value = normalizeSpecifier ( moduleName , specifier . value ) ;
598
+ }
599
+ this . traverse ( path ) ;
600
+ } ,
601
+
587
602
// We need to rewrite annotations like `export const: import('./foo').foo`
588
603
// to use relative paths, as well.
589
604
visitTSImportType ( path ) {
You can’t perform that action at this time.
0 commit comments