Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Commit

Permalink
fix(babelrc): add a key for each env development, production, es (#547)
Browse files Browse the repository at this point in the history
* fix(babelrc): add a key for each env development, production, es

* fix(babelrc): add missing env for "test" because Jest run with NODE_ENV=test by default
  • Loading branch information
samouss authored Nov 2, 2017
1 parent 83b33d7 commit fa9528d
Showing 1 changed file with 52 additions and 15 deletions.
67 changes: 52 additions & 15 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
// This could be written a lot more easily using .babelrc.js but currently
// not released. And the merging around the env option is broken
// refs: https://github.com/babel/babel/issues/5276

{
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions", "ie >= 9"]
}
}],
"react",
"stage-2",
],
"plugins": ["lodash", "inline-json-import"],
"env": {
"development": {
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions", "ie >= 9"]
}
"browsers": [
"last 2 versions",
"ie >= 9",
],
},
}],
"react",
"stage-2",
Expand All @@ -36,21 +30,64 @@
"transform-regenerator"
]
},
"test": {
"presets": [
["env", {
"targets": {
"browsers": [
"last 2 versions",
"ie >= 9",
],
},
}],
"react",
"stage-2",
],
"plugins": [
"lodash",
"inline-json-import",
],
},
"production": {
"presets": [
["env", {
"targets": {
"browsers": [
"last 2 versions",
"ie >= 9",
],
},
}],
"react",
"stage-2",
],
"plugins": [
"lodash",
"inline-json-import",
],
},
"es": {
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions", "ie >= 9"]
"browsers": [
"last 2 versions",
"ie >= 9",
],
},
"modules": false
"modules": false,
}],
"react",
"stage-2",
],
"plugins": ["lodash", "inline-json-import"]
"plugins": [
"lodash",
"inline-json-import",
]
}
}
}

// Once we are using Babel 7 and babelrc.js, here's the code to use
// const env = process.env.NODE_ENV || 'development';
// const modules = process.env.MODULES || 'commonjs';
Expand Down

0 comments on commit fa9528d

Please sign in to comment.