mirror of https://github.com/status-im/metro.git
[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
44b97249e9
commit
cc01b6daf4
|
@ -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