diff --git a/createWebpackConfig.js b/createWebpackConfig.js index fadd68d..582dae4 100644 --- a/createWebpackConfig.js +++ b/createWebpackConfig.js @@ -29,11 +29,24 @@ module.exports = function createWebpackConfig(_options) { config.output.filename = options.filename; if (options.minify) { - config.plugins.push(new webpack.optimize.UglifyJsPlugin({ - compressor: { - screw_ie8: true, - }, - })); + config.plugins.push( + new webpack.optimize.UglifyJsPlugin({ + compressor: { + screw_ie8: true, + warnings: false, + }, + }) + ); + } + + if (options.env) { + config.plugins.push( + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify(options.env), + }, + }) + ); } return config; diff --git a/gulpfile.js b/gulpfile.js index 15627c4..d54480b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -76,6 +76,7 @@ gulp.task('webpack:standalone:min', function() { var config = createWebpackConfig({ filename: 'updeep-standalone.min.js', minify: true, + env: 'production', }); return gulp.src('lib/index.js')