diff options
author | 2018-11-07 12:55:35 +0300 | |
---|---|---|
committer | 2018-11-07 12:55:35 +0300 | |
commit | c430469f1fe371300dcef9ad17c61b06af756f64 (patch) | |
tree | 283b86d2036aab34656c6347a43efc8f9f2cfa0f /juick-server/webpack.config.js | |
parent | 53c6442f752b2ed51e3c9b8b9eed235ffba8d75e (diff) |
www: es6.promise polyfill and config cleanup
Diffstat (limited to 'juick-server/webpack.config.js')
-rw-r--r-- | juick-server/webpack.config.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/juick-server/webpack.config.js b/juick-server/webpack.config.js index 42c0a775..52fd2926 100644 --- a/juick-server/webpack.config.js +++ b/juick-server/webpack.config.js @@ -5,10 +5,12 @@ const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); module.exports = (env, argv) => { const dev = argv.mode !== 'production'; - return { + const config = { devtool: dev ? 'source-map' : false, entry: { 'scripts': [ + 'core-js/modules/es6.promise', + 'whatwg-fetch', __dirname + '/src/main/assets/scripts.js', require.resolve('evil-icons/assets/evil-icons.js') ], @@ -47,19 +49,22 @@ module.exports = (env, argv) => { { test: /\.svg$/, loader: 'url-loader?limit=10000000000' } ] }, - optimization: { + plugins: [ + new StyleLintPlugin({ configFile: '.stylelintrc.json', context: 'src/main/assets', files: ['**/*.css'], emitErrors: false }), + new MiniCssExtractPlugin({ filename: 'style.css', allChunks: true }) + ], + }; + if (dev) { + config.optimization = { minimizer: [ new UglifyJsPlugin({ cache: true, parallel: true, sourceMap: dev }), - new OptimizeCSSAssetsPlugin({}) + new OptimizeCSSAssetsPlugin({}) ] - }, - plugins: [ - new StyleLintPlugin({ configFile: '.stylelintrc.json', context: 'src/main/assets', files: ['**/*.css'], emitErrors: false }), - new MiniCssExtractPlugin({ filename: 'style.css', allChunks: true }) - ], - }; + }; + } + return config; }; |