diff --git a/transformer.js b/transformer.js index 0c0a98a9..8f7a48c2 100644 --- a/transformer.js +++ b/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 || {},