From eeb65a61fda4e5aa7baea5946c4a315cfc933e2f Mon Sep 17 00:00:00 2001 From: Ivan Akulov Date: Thu, 4 Jan 2018 00:35:15 +0300 Subject: [PATCH] Enable minification --- webpack.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 0b8ecd9..3566d08 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -12,6 +12,7 @@ */ const path = require('path'); +const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin'); @@ -60,7 +61,10 @@ module.exports = { }), ].concat( isProduction - ? [] + ? [ + // Minimize the app code + new webpack.optimize.UglifyJsPlugin(), + ] : [ // Force writing the HTML files to disk when running in the development mode // (otherwise, webpack-dev-server won’t serve the app)