From f23758e100a3bee5c2e76f4811d7565b43104ae5 Mon Sep 17 00:00:00 2001 From: Kitteh Date: Sun, 30 May 2021 09:25:53 +0100 Subject: [PATCH] Compress CSS. --- package.json | 3 +++ webpack.config.js | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/package.json b/package.json index 1f1cc3a..51a3a78 100644 --- a/package.json +++ b/package.json @@ -43,5 +43,8 @@ "webpack-cli": "^4.7.0", "webpack-dev-server": "^3.11.2", "z-pagerouter": "^1.0.5" + }, + "dependencies": { + "css-minimizer-webpack-plugin": "^3.0.0" } } diff --git a/webpack.config.js b/webpack.config.js index de54231..bb3c1db 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,6 +2,8 @@ const path = require('path'); const webpack = require('webpack'); var os = require("os"); +const TerserPlugin = require("terser-webpack-plugin"); +const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const { GitRevisionPlugin } = require('git-revision-webpack-plugin'); @@ -93,4 +95,17 @@ module.exports = { } ], }, + + optimization: { + minimize: true, + minimizer: [ + `...`, + new TerserPlugin({ + terserOptions: { + ecma: "2015" + } + }), + new CssMinimizerPlugin(), + ], + }, }; \ No newline at end of file