From f8393b6ec298b1a99e279386ed6c56f8f4070492 Mon Sep 17 00:00:00 2001 From: Anders Evenrud Date: Thu, 4 Aug 2022 03:12:48 +0200 Subject: [PATCH] Upgrade to Webpack 5 Refs https://github.com/os-js/osjs-dev-meta/issues/25 --- webpack.config.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index aca31474..b42e8545 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,18 +1,23 @@ const path = require('path'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); -const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); +const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const mode = process.env.NODE_ENV || 'development'; const minimize = mode === 'production'; const plugins = []; if (mode === 'production') { - plugins.push(new OptimizeCSSAssetsPlugin({ - cssProcessorOptions: { - discardComments: true, - map: { - inline: false - } + plugins.push(new CssMinimizerPlugin({ + minimizerOptions: { + preset: [ + 'default', + { + discardComments: {removeAll: true}, + map: { + inline: false, + }, + }, + ], }, })); }