Fixes from review

This commit is contained in:
Brian Ng 2017-08-04 09:32:36 -05:00
parent af5f34ace5
commit 2a83867436
No known key found for this signature in database
GPG Key ID: 3F2380E1E1508CA9
2 changed files with 31 additions and 1 deletions

View File

@ -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 }]
]
}
}
}
```

View File

@ -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": {