From ca389084230298e3c02da9792f2852c55414be27 Mon Sep 17 00:00:00 2001 From: Amjad Masad Date: Sat, 15 Aug 2015 15:59:37 -0700 Subject: [PATCH] [react-packager] In production resolve __DEV__ to NODE_ENV === 'development' --- packager/transformer.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packager/transformer.js b/packager/transformer.js index 0c0a98a92..8f7a48c29 100644 --- a/packager/transformer.js +++ b/packager/transformer.js @@ -13,6 +13,12 @@ var babel = require('babel-core'); 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, { retainLines: true, compact: true, @@ -35,7 +41,7 @@ function transform(srcTxt, filename, options) { 'react', 'regenerator', ], - plugins: ['node-env-inline'], + plugins: plugins, sourceFileName: filename, sourceMaps: false, extra: options || {},