[react-native] Set NODE_ENV and use node-env-inline plugin
Summary: This sets NODE_ENV based on the value of the `dev` option when bundling the apps. This would then be inlined by the node-env-inline babel plugin. And finally -- if unreachable -- will be dead-code-eliminated by uglify. This is not used in development because we set NODE_ENV to the value of __DEV__, which can be switched via a query param. However, the plugin has minimal overhead and to avoid complexity in the transformers I just enabled it by default.
This commit is contained in:
parent
9d96d00163
commit
9eb5151bd2
|
@ -35,6 +35,7 @@ function transform(srcTxt, filename, options) {
|
||||||
'react',
|
'react',
|
||||||
'regenerator',
|
'regenerator',
|
||||||
],
|
],
|
||||||
|
plugins: ['node-env-inline'],
|
||||||
sourceFileName: filename,
|
sourceFileName: filename,
|
||||||
sourceMaps: false,
|
sourceMaps: false,
|
||||||
extra: options || {},
|
extra: options || {},
|
||||||
|
|
Loading…
Reference in New Issue