[react-packager] In production resolve __DEV__ to NODE_ENV === 'development'
This commit is contained in:
parent
3388d8fe79
commit
ca38908423
|
@ -13,6 +13,12 @@
|
||||||
var babel = require('babel-core');
|
var babel = require('babel-core');
|
||||||
|
|
||||||
function transform(srcTxt, filename, options) {
|
function transform(srcTxt, filename, options) {
|
||||||
|
var plugins = [];
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
plugins = plugins.concat(['node-env-inline', 'dunderscore-dev-inline']);
|
||||||
|
}
|
||||||
|
|
||||||
var result = babel.transform(srcTxt, {
|
var result = babel.transform(srcTxt, {
|
||||||
retainLines: true,
|
retainLines: true,
|
||||||
compact: true,
|
compact: true,
|
||||||
|
@ -35,7 +41,7 @@ function transform(srcTxt, filename, options) {
|
||||||
'react',
|
'react',
|
||||||
'regenerator',
|
'regenerator',
|
||||||
],
|
],
|
||||||
plugins: ['node-env-inline'],
|
plugins: plugins,
|
||||||
sourceFileName: filename,
|
sourceFileName: filename,
|
||||||
sourceMaps: false,
|
sourceMaps: false,
|
||||||
extra: options || {},
|
extra: options || {},
|
||||||
|
|
Loading…
Reference in New Issue