Skip to content

Commit

Permalink
feat: add identifier support to export all
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbonnet committed Jan 3, 2021
1 parent b95ef6a commit a646dfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/astring.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,11 @@ export const baseGenerator = {
}
},
ExportAllDeclaration(node, state) {
state.write('export * from ')
if (node.exported != null) {
state.write('export * as ' + node.exported.name + ' from ')
} else {
state.write('export * from ')
}
this.Literal(node.source, state)
state.write(';')
},
Expand Down
1 change: 1 addition & 0 deletions src/tests/fixtures/syntax/export.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from "module";
export * as m from "module";
export {name} from "module";
export {a as b, c as d} from "module";
let e, g;
Expand Down

0 comments on commit a646dfa

Please sign in to comment.