Skip to content

Commit

Permalink
Use babel in es6 build also, to transform class properties (which are…
Browse files Browse the repository at this point in the history
… not spec yet)
  • Loading branch information
benadamstyles committed Apr 18, 2018
1 parent b5c0742 commit 39c8d91
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 32 deletions.
79 changes: 49 additions & 30 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,32 +1,51 @@
{
"presets": [
[
"env",
{
"targets": {
"browsers": [
"Chrome >= 36",
"Edge >= 12",
"Firefox >= 6",
"Explorer >= 11",
"Opera >= 23",
"Safari >= 8",
"Android >= 36",
"ChromeAndroid >= 36",
"FirefoxAndroid >= 6",
"ExplorerMobile >= 11",
"OperaMobile >= 23",
"iOS >= 8"
],
"node": "6"
}
}
],
"react"
],
"plugins": [
"transform-flow-strip-types",
"transform-class-properties",
"add-module-exports"
]
"env": {
"es5": {
"presets": [
[
"env",
{
"targets": {
"browsers": [
"Chrome >= 36",
"Edge >= 12",
"Firefox >= 6",
"Explorer >= 11",
"Opera >= 23",
"Safari >= 8",
"Android >= 36",
"ChromeAndroid >= 36",
"FirefoxAndroid >= 6",
"ExplorerMobile >= 11",
"OperaMobile >= 23",
"iOS >= 8"
],
"node": "6"
}
}
],
"react"
],
"plugins": [
"transform-flow-strip-types",
"transform-class-properties",
"add-module-exports"
]
},
"es6": {
"presets": [
[
"env",
{
"targets": {
"node": "9"
},
"modules": false
}
],
"react"
],
"plugins": ["transform-flow-strip-types", "transform-class-properties"]
}
}
}
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
"test:lib": "jest --silent --config=\"{\\\"moduleNameMapper\\\":{\\\"^./set-future-state$\\\":\\\"<rootDir>/lib/set-future-state\\\"}}\"",
"test": "jest --silent --coverage",
"posttest": "jest-coverage-ratchet",
"test:all": "yarn lint && yarn run flow check && yarn test && yarn run test:lib",
"build": "babel src --out-dir lib --ignore src/set-future-state.test.js,src/set-future-state-unsupported.test.js,src/flow-tests.js && cp src/set-future-state.js.flow lib && flow-remove-types --pretty src/set-future-state.js > lib/set-future-state.esm.js",
"test:all": "export BABEL_ENV=es5 yarn lint && yarn run flow check && yarn test && yarn run test:lib",
"build:es5": "BABEL_ENV=es5 babel src/set-future-state.js --out-file lib/set-future-state.js",
"build:es6": "BABEL_ENV=es6 babel src/set-future-state.js --out-file lib/set-future-state.esm.js",
"build": "yarn build:es5 && yarn build:es6",
"postbuild": "cp src/set-future-state.js.flow lib",
"prepare": "yarn build",
"release": "release-it"
},
Expand Down

0 comments on commit 39c8d91

Please sign in to comment.