[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:
Amjad Masad 2015-08-15 12:21:50 -07:00
parent 44b97249e9
commit cc01b6daf4
1 changed files with 1 additions and 0 deletions

View File

@ -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 || {},