From 88240b4ffd049bd3ec86612ad89f830cad4243ac Mon Sep 17 00:00:00 2001 From: Jon Roach Date: Thu, 5 Oct 2017 11:43:41 -0700 Subject: [PATCH] config --- webpack.config.js | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index f8b9ea8..fc2e75e 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -67,27 +67,32 @@ module.exports = (env) => { ], }; - const launch = { - output: { - path: path.join(__dirname, 'plugin/npm-module/build'), - filename: 'app.js', + const launch = merge([ + { + output: { + path: path.join(__dirname, 'plugin/npm-module/build'), + filename: 'app.js', + }, + plugins: [ + new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('data') }), + new WebpackMonitor({ launch: true, capture: false }), + ], }, - plugins: [ - new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('data') }), - new WebpackMonitor({ launch: true, capture: false }), - ], - }; + utils.uglifyJS(), + ]); - const confirm = { - output: { - path: path.join(__dirname, 'plugin/npm-module/build'), - filename: 'app.js', + const confirm = merge([ + { + output: { + path: path.join(__dirname, 'plugin/npm-module/build'), + filename: 'app.js', + }, + plugins: [ + new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('data') }), + new WebpackMonitor({ capture: true }), + ], }, - plugins: [ - new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify('data') }), - new WebpackMonitor({ capture: true }), - ], - }; + ]); if (env === 'development') return merge([common, development]); if (env === 'confirm') return merge([common, confirm]);