webpack: Move to css-minimizer-webpack-plugin

optimize-css-assets-webpack-plugin is not supported for webpack 5 any
more.

This also brings us closer to what starter-kit, podman, and machines are
doing.
This commit is contained in:
Martin Pitt 2021-04-12 08:56:41 +02:00 committed by Katerina Koukiou
parent c7b4449fab
commit be62ebc578
2 changed files with 3 additions and 5 deletions

View File

@ -39,6 +39,7 @@
"chrome-remote-interface": "^0.28.1",
"copy-webpack-plugin": "^5.1.1",
"css-loader": "^3.4.2",
"css-minimizer-webpack-plugin": "^1.3.0",
"eslint": "^7.10.0",
"eslint-config-standard": "^14.1.1",
"eslint-config-standard-jsx": "^10.0.0",
@ -59,7 +60,6 @@
"jed": "^1.1.1",
"mini-css-extract-plugin": "^1.4.0",
"null-loader": "^3.0.0",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"po2json": "^1.0.0-alpha",
"raw-loader": "^4.0.0",
"sass": "^1.26.5",

View File

@ -249,7 +249,7 @@ const copy = require("copy-webpack-plugin");
const html = require('html-webpack-plugin');
const miniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserJSPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
const ESLintPlugin = require('eslint-webpack-plugin');
const CockpitPoPlugin = require("./pkg/lib/cockpit-po-plugin");
const IncludedModulesPlugin = require("./pkg/lib/included-modules-plugin");
@ -344,8 +344,6 @@ function get_msggrep_options () {
return undefined;
}
const cssProcessorOptions = production ? { } : { map: {inline: false} };
const plugins = [
new IncludedModulesPlugin((section || "") + "included-modules"),
new copy(info.files),
@ -435,7 +433,7 @@ module.exports = {
optimization: {
minimize: production,
minimizer: [new TerserJSPlugin({ extractComments : false }), new OptimizeCSSAssetsPlugin({cssProcessorOptions: cssProcessorOptions})],
minimizer: [new TerserJSPlugin({ extractComments : false }), new CssMinimizerPlugin()],
},
module: {