Fixes from review
This commit is contained in:
parent
af5f34ace5
commit
2a83867436
@ -87,3 +87,34 @@ require("babel-core").transform("code", {
|
||||
`boolean`, defaults to `false`.
|
||||
|
||||
Toggles plugins that aid in development, such as [`babel-plugin-transform-react-jsx-self`](https://babeljs.io/docs/plugins/transform-react-jsx-self/) and [`babel-plugin-transform-react-jsx-source`](https://babeljs.io/docs/plugins/transform-react-jsx-source/).
|
||||
|
||||
This is useful when combined with either a `babelrc.js` or [env option in a .babelrc](https://babeljs.io/docs/usage/babelrc/#env-option) configuration:
|
||||
|
||||
#### babelrc.js
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
presets: [
|
||||
["react", {
|
||||
development: process.env.BABEL_ENV === "development"
|
||||
}],
|
||||
],
|
||||
}
|
||||
```
|
||||
|
||||
#### .babelrc
|
||||
|
||||
> Note: the `env` option will likely get deprecated soon
|
||||
|
||||
```json
|
||||
{
|
||||
"presets": ["react"],
|
||||
"env": {
|
||||
"development": {
|
||||
"presets": [
|
||||
["react", { "development": true }]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@ -13,7 +13,6 @@
|
||||
"babel-plugin-transform-react-display-name": "7.0.0-alpha.18",
|
||||
"babel-plugin-transform-react-jsx": "7.0.0-alpha.18",
|
||||
"babel-plugin-transform-react-jsx-self": "7.0.0-alpha.18",
|
||||
"babel-plugin-transform-react-jsx-source": "7.0.0-alpha.18",
|
||||
"babel-plugin-transform-react-jsx-source": "7.0.0-alpha.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user