From 2bb6ca754d7cdf5233cdb7e32bfb3b44bf8e1d94 Mon Sep 17 00:00:00 2001 From: Dominic Masters Date: Wed, 11 Jul 2018 08:02:08 +1000 Subject: [PATCH] Added CSS Compression (Webpack 4 support) --- package.json | 1 + private/server/WebpackCompilerOptions.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 944c5ab..dcdc1e5 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "mini-css-extract-plugin": "^0.4.1", "node-sass": "^4.9.0", "nodemailer": "^4.6.7", + "optimize-css-assets-webpack-plugin": "^4.0.3", "pg-promise": "^8.4.4", "react": "^16.4.0", "react-dom": "^16.4.0", diff --git a/private/server/WebpackCompilerOptions.js b/private/server/WebpackCompilerOptions.js index fa52083..0b351b3 100644 --- a/private/server/WebpackCompilerOptions.js +++ b/private/server/WebpackCompilerOptions.js @@ -28,7 +28,8 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'), CompressionPlugin = require("compression-webpack-plugin"), UglifyJsPlugin = require('uglifyjs-webpack-plugin'), - MiniCssExtractPlugin = require("mini-css-extract-plugin") + MiniCssExtractPlugin = require("mini-css-extract-plugin"), + OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin"); ; //Constants @@ -136,7 +137,8 @@ module.exports = function(server, app) { output.optimization = { minimize: true, minimizer: [ - UglifyPluginConfig + UglifyPluginConfig, + new OptimizeCSSAssetsPlugin({}) ] };