Ensure default exported classes keep entry in export table (#5488)

This commit is contained in:
Brian Ng
2017-04-09 18:39:15 -05:00
committed by Logan Smyth
parent 769eddc788
commit cd9bb7ba10
13 changed files with 20 additions and 6 deletions

View File

@@ -17,7 +17,10 @@ export default function ({ types: t }) {
// Split the class declaration and the export into two separate statements.
path.replaceWith(node.declaration);
path.insertAfter(t.exportDefaultDeclaration(ref));
path.insertAfter(t.exportNamedDeclaration(
null,
[t.exportSpecifier(ref, t.identifier("default"))]
));
},
ClassDeclaration(path) {