Skip to content

Commit

Permalink
fix: register inserted importDefaultSpecifier
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jul 5, 2019
1 parent bff79e1 commit c301efb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
Expand Up @@ -35,6 +35,11 @@ export default declare(api => {

path.replaceWithMultiple(nodes);
},
ImportDefaultSpecifier(path) {
if (!path.scope.hasOwnBinding(path.node.local.name)) {
path.scope.registerDeclaration(path.parentPath);
}
},
},
};
});
@@ -0,0 +1 @@
export foo from "bar";
@@ -0,0 +1,3 @@
{
"plugins": ["proposal-export-default-from", "transform-typescript"]
}
@@ -0,0 +1,2 @@
import _foo from "bar";
export { _foo as foo };

0 comments on commit c301efb

Please sign in to comment.