fix: register injected importDeclaration (#10172)

This commit is contained in:
Huáng Jùnliàng 2019-07-06 11:44:14 -04:00 committed by Brian Ng
parent c777e81e06
commit 075a50242d
8 changed files with 16 additions and 2 deletions

View File

@ -33,7 +33,8 @@ export default declare(api => {
nodes.push(node); nodes.push(node);
} }
path.replaceWithMultiple(nodes); const [importDeclaration] = path.replaceWithMultiple(nodes);
path.scope.registerDeclaration(importDeclaration);
}, },
}, },
}; };

View File

@ -0,0 +1 @@
export foo from "bar";

View File

@ -0,0 +1,3 @@
{
"plugins": ["proposal-export-default-from", "transform-typescript"]
}

View File

@ -0,0 +1,2 @@
import _foo from "bar";
export { _foo as foo };

View File

@ -43,7 +43,8 @@ export default declare(api => {
nodes.push(node); nodes.push(node);
} }
path.replaceWithMultiple(nodes); const [importDeclaration] = path.replaceWithMultiple(nodes);
path.scope.registerDeclaration(importDeclaration);
}, },
}, },
}; };

View File

@ -0,0 +1 @@
export * as foo from "bar";

View File

@ -0,0 +1,3 @@
{
"plugins": ["proposal-export-namespace-from", "transform-typescript"]
}

View File

@ -0,0 +1,2 @@
import * as _foo from "bar";
export { _foo as foo };