Skip to content

Commit 977a3e0

Browse files
committed
Include advice about environments in README
1 parent 51cc00f commit 977a3e0

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

README.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,35 @@ It must be an array of the transforms you want to use:
3131

3232
```js
3333
{
34-
"stage": 0,
35-
"plugins": [
36-
"react-transform"
37-
],
38-
"extra": {
39-
// must be defined and be an array
40-
"react-transform": [{
41-
"target": "react-transform-catch-errors",
42-
// now go the imports!
43-
// the first import is your React distribution
44-
// (if you use React Native, pass "react-native" instead)
45-
// the second import is the React component to render error
46-
// (it can be a local path too, like "./src/ErrorReporter")
47-
"imports": ["react", "redbox-react"]
48-
}]
49-
// note: you can put more transforms into array
50-
// this is just one of them!
34+
"stage": 0,
35+
"env": {
36+
"development": {
37+
// this plugin will be included only in development mode, e.g.
38+
// if NODE_ENV (or BABEL_ENV) environment variable is not set
39+
// or is equal to "development"
40+
"plugins": [
41+
"react-transform"
42+
],
43+
"extra": {
44+
// must be defined and be an array
45+
"react-transform": [{
46+
"target": "react-transform-catch-errors",
47+
// now go the imports!
48+
// the first import is your React distribution
49+
// (if you use React Native, pass "react-native" instead)
50+
// the second import is the React component to render error
51+
// (it can be a local path too, like "./src/ErrorReporter")
52+
"imports": ["react", "redbox-react"]
53+
}]
54+
// note: you can put more transforms into array
55+
// this is just one of them!
56+
}
57+
}
5158
}
5259
}
5360
```
5461

55-
This transform has no effect when `process.env.NODE_ENV` is set to `'production'`.
62+
This transform has no effect when `process.env.NODE_ENV` is set to `'production'`. You can further restrict the environments it runs in by setting them in `.babelrc` as above.
5663

5764
## License
5865

0 commit comments

Comments
 (0)