Skip to content

Commit

Permalink
fix(babel-plugin-export-metadata): fix re-export default (#790) (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework authored and pedronauck committed Apr 13, 2019
1 parent e1f2849 commit 89b3928
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions other-packages/babel-plugin-export-metadata/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,17 @@ const insertNodeExport = t => (path, state) => {
addFileMetaProperties(t, path, filename, name)
} else if (declarations) {
for (declaration of declarations) {
declarationName = get(declaration, 'id.name')
const declarationName = get(declaration, 'id.name')
addFileMetaProperties(t, path, filename, declarationName)
}
} else if (specifiers) {
for (specifier of specifiers) {
specifierName = get(specifier, 'local.name')
let specifierName = get(specifier, 'local.name')
specifierName =
specifierName === 'default'
? get(specifier, 'exported.name')
: specifierName

addFileMetaProperties(t, path, filename, specifierName)
}
}
Expand Down

0 comments on commit 89b3928

Please sign in to comment.