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) {
542542
543543 // Remove `declare` from `declare function` in the top-level module.
544544 visitTSDeclareFunction ( path ) {
545- if ( isTSDeclareFunction ( path . node ) && ! hasParentModuleDeclarationBlock ( path ) ) {
545+ if ( ! hasParentModuleDeclarationBlock ( path ) ) {
546546 path . node . declare = false ;
547547 }
548548 this . traverse ( path ) ;
549549 } ,
550550
551+ visitTSInterfaceDeclaration ( path ) {
552+ if ( ! hasParentModuleDeclarationBlock ( path ) ) {
553+ path . node . declare = false ;
554+ }
555+ this . traverse ( false ) ;
556+ } ,
557+
551558 // Remove `declare` from `declare enum` in the top-level module.
552559 visitTSEnumDeclaration ( path ) {
553560 if ( isTSEnumDeclaration ( path . node ) && ! hasParentModuleDeclarationBlock ( path ) ) {
@@ -584,6 +591,14 @@ export function rewriteModule(code, moduleName) {
584591 this . traverse ( path ) ;
585592 } ,
586593
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+
587602 // We need to rewrite annotations like `export const: import('./foo').foo`
588603 // to use relative paths, as well.
589604 visitTSImportType ( path ) {
You can’t perform that action at this time.
0 commit comments