From 4a801d266e2ce1dceae2aaa8c4323bfbed44fa60 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Tue, 13 Mar 2018 11:19:30 +0000 Subject: [PATCH] Copy paste some prod webpack config from v1 --- services/web/webpack.config.prod.js | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 services/web/webpack.config.prod.js diff --git a/services/web/webpack.config.prod.js b/services/web/webpack.config.prod.js new file mode 100644 index 0000000000..550b874aa2 --- /dev/null +++ b/services/web/webpack.config.prod.js @@ -0,0 +1,32 @@ +const webpack = require('webpack') +const merge = require('webpack-merge') + +const base = require('./webpack.config') + +module.exports = merge(base, { + // Enable a full source map. + devtool: 'source-map', + + output: { + // Overwrite the default filename to include the chunkhash. This versions + // the output files so that they can be cached (and cache-busted when they + // change) + filename: '[name]-[chunkhash].js' + }, + + plugins: [ + // Use UglifyJS to minimise output + new webpack.optimize.UglifyJsPlugin({ + // Enable compression (options here are UglifyJS options) + compress: { + drop_console: true, // Remove console logs + warnings: false // Silence Uglify warnings + }, + output: { + comments: false // Remove comments + }, + // Prevent source map files from being stripped out of bundle + sourceMap: true + }) + ] +})