Skip to content

Commit

Permalink
handle CommonJS exports so users don’t have to import .default
Browse files Browse the repository at this point in the history
  • Loading branch information
benadamstyles committed Apr 1, 2018
1 parent 2025a36 commit 98a0c5b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@
],
"react"
],
"plugins": ["transform-flow-strip-types", "transform-class-properties"]
"plugins": [
"transform-flow-strip-types",
"transform-class-properties",
"add-module-exports"
]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"runkitExample": "const {ComponentFutureState} = require('set-future-state')",
"runkitExample": "const withFutureState = require('set-future-state')",
"scripts": {
"lint": "eslint .",
"pretest:lib": "yarn build",
Expand Down Expand Up @@ -50,6 +50,7 @@
"babel-cli": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-jest": "^22.4.3",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-env": "^1.6.1",
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,10 @@ babel-messages@^6.23.0:
dependencies:
babel-runtime "^6.22.0"

babel-plugin-add-module-exports@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz#9ae9a1f4a8dc67f0cdec4f4aeda1e43a5ff65e25"

babel-plugin-check-es2015-constants@^6.22.0:
version "6.22.0"
resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a"
Expand Down

0 comments on commit 98a0c5b

Please sign in to comment.