From 4ab75675f6c9b4c2c4e25335243a386e03e633c3 Mon Sep 17 00:00:00 2001 From: zutto Date: Mon, 27 May 2024 09:46:25 +0300 Subject: [PATCH] added css minimizer to webpack --- package.json | 1 + webpack.config.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/package.json b/package.json index c1ce282..2c4847b 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "license": "ISC", "devDependencies": { "css-loader": "^7.1.2", + "css-minimizer-webpack-plugin": "^7.0.0", "mini-css-extract-plugin": "^2.9.0", "style-loader": "^4.0.0", "webpack": "^5.91.0", diff --git a/webpack.config.js b/webpack.config.js index c6d3672..f6af3d8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,7 @@ const path = require('path'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); + module.exports = { entry: './src/js/app.js', @@ -15,6 +17,11 @@ module.exports = { }, ], }, + optimization: { + minimizer: [ + new CssMinimizerPlugin(), + ], + }, plugins: [ new MiniCssExtractPlugin({ filename: 'styles.css',