You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-18Lines changed: 25 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,28 +31,35 @@ It must be an array of the transforms you want to use:
31
31
32
32
```js
33
33
{
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
+
}
51
58
}
52
59
}
53
60
```
54
61
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.
0 commit comments