From bcfd90a7c1a8d6985e434c2439f2978e9d6dad7a Mon Sep 17 00:00:00 2001 From: NI Date: Sun, 12 Dec 2021 21:02:01 +0800 Subject: [PATCH] Compress image assets correctly --- webpack.config.js | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index c9cd00bc..88c4c885 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -444,31 +444,11 @@ module.exports = { implementation: ImageMinimizerPlugin.imageminMinify, options: { plugins: [ - "imagemin-gifsicle", - "imagemin-mozjpeg", - "imagemin-pngquant", - "imagemin-svgo", + ["imagemin-gifsicle", { interlaced: true, }], + ["imagemin-mozjpeg", { progressive: true, }], + ["imagemin-pngquant", { quality: [0.02, 0.2], }], + // ["imagemin-svgo", { plugins: ["preset-default"], }], ], - encodeOptions: { - webp: { - quality: 50, - method: 6, - lossless: false, - metadata: "none", - }, - gifsicle: { - interlaced: true, - }, - mozjpeg: { - progressive: true, - }, - pngquant: { - quality: [0.02, 0.2], - }, - svgo: { - plugins: ["preset-default"], - }, - }, }, }, })