From 938e8b4ebb1178f81dfea5b4ce2f9702863dcb1d Mon Sep 17 00:00:00 2001 From: Alice Gaudon Date: Mon, 7 Jun 2021 11:24:52 +0200 Subject: [PATCH] Add imagemin-webp --- package.json | 1 + webpack.config.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 34cc701..b283146 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "imagemin-mozjpeg": "^9.0.0", "imagemin-pngquant": "^9.0.2", "imagemin-svgo": "^9.0.0", + "imagemin-webp": "^6.0.0", "jest": "^27.0.4", "maildev": "^1.1.0", "mini-css-extract-plugin": "^1.2.1", diff --git a/webpack.config.js b/webpack.config.js index 20449a8..b624595 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,7 @@ const path = require('path'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const ImageMinimizerPlugin = require("image-minimizer-webpack-plugin"); -const { extendDefaultPlugins } = require("svgo"); +const {extendDefaultPlugins} = require("svgo"); const TerserPlugin = require('terser-webpack-plugin'); const dev = process.env.NODE_ENV === 'development'; @@ -84,6 +84,7 @@ const config = { ["gifsicle", {}], ["mozjpeg", {}], ["pngquant", {}], + ["webp", {quality: 90}], // Svgo configuration here https://github.com/svg/svgo#configuration [ "svgo", @@ -96,7 +97,7 @@ const config = { { name: "addAttributesToSVGElement", params: { - attributes: [{ xmlns: "http://www.w3.org/2000/svg" }], + attributes: [{xmlns: "http://www.w3.org/2000/svg"}], }, }, ]),