imagemin-webp-webpack-plugin
imagemin-webp-webpack-plugin copied to clipboard
exclude rule
Hello, thanks for this wonderful plugin, I have tried many before, but because of my little experience with webpack, I didn’t get what I wanted or didn’t work at all (((
This great plugin worked the first time as it should, amazing! (although to be honest, I first tried to clone the repository and run it locally with webpack 5 and it didn’t work for me - first there was an error with the lack of rm (I have windows), then with the lack of imgmin-gif2webp ))
I just have one question right now that I would like to clarify - is it possible to use a path here to exclude certain directories?
I have a project structure like this:
root -favicon -imgBuild -static --src ---imgsrc ---media ----favicon ----other
when I started project images from imgsrc moving to imgBuild(throw file-loader) and images and other materials from directory media moving to root.
I tried like this:
new ImageminWebpWebpackPlugin({ detailedLogs: true, overrideExtension: true, config: [{ test: /\.(jpe?g|png|gif)/, exclude: /favicon/, options: { quality: 75 } }], }),
and changed to this:
exclude: /media/,
but it's not worked for me(
https://github.com/Nikolasgrizli/Starter-webpack5- and at the same time I wanted to know - what am I doing wrong if I have to convert images with every change(scss,pug,js. etc)? (the assembly is the same, only the destination folder is different)