webpack compression plugin (activated in production config)

This commit is contained in:
Michael Bradley, Jr 2018-08-17 12:33:15 -05:00
parent 16856eadf0
commit 4acf0ad58d
1 changed files with 2 additions and 0 deletions

View File

@ -18,6 +18,7 @@
// there's a bug in pkg clone-deep re: regex; for now use lodash.clonedeep
// see: https://github.com/jonschlinkert/clone-deep/pull/14
const cloneDeep = require('lodash.clonedeep');
const CompressionPlugin = require('compression-webpack-plugin');
const fs = require('fs');
const glob = require('glob');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
@ -156,6 +157,7 @@ devBabelLoader.options.compact = false;
const production = cloneDeep(base);
production.mode = 'production';
production.name = 'production';
production.plugins.push(new CompressionPlugin());
// export a list of named configs
// -----------------------------------------------------------------------------