Skip to content

Commit

Permalink
fix: handle babel-preset-env 7.4.3
Browse files Browse the repository at this point in the history
`[email protected]` has changed the format of how default exports
are generated. This change makes sure the tests pass with the dependency
upgraded.

closes #73
  • Loading branch information
TheLudd committed Apr 4, 2019
1 parent e8e5be0 commit 25626f3
Show file tree
Hide file tree
Showing 3 changed files with 456 additions and 339 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-export-default-from": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-env": "^7.4.3",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.6",
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ class ExportsFinder {
}

const objectName = path.get(`${property}.left.object.name`).node
const propertyName = path.get(`${property}.left.property.name`).node
const propertyName =
path.get(`${property}.left.property.name`).node ||
path.get(`${property}.left.property.value`).node
if (objectName === 'exports' || objectName === '_exports') {
if (propertyName === 'default') {
this.hasExportsDefault = true
Expand Down
Loading

0 comments on commit 25626f3

Please sign in to comment.