+
+if (process.argv.indexOf('--optimize-minimize') !== -1) {
+ // we are going to output a gzip file in the production process
+ config.output.filename = "gzip-" + config.output.filename;
+ config.plugins.push(new webpack.DefinePlugin({ // <-- key to reducing React's size
+ 'process.env': {
+ 'NODE_ENV': JSON.stringify('production')
+ }
+ }));
+ config.plugins.push(new CompressionPlugin({
+ asset: "[path]", // overwrite js file with gz file
+ algorithm: "gzip",
+ test: /\.(js)$/
+ }));
+}