Webpack plugin that converts JPEG, PNG, and GIF images to WebP format while preserving original files. Wraps imagemin, imagemin-webp, and imagemin-gif2webp. Compatible with Webpack 5, 4, and earlier. v3.3.6 stable release with regular dependency updates. Key differentiator: keeps originals and supports GIF via gif2webp. Configurable quality, extension override, detailed logs, silent mode, and strict error handling. A known issue exists with css-loader when importing .webp files that don't exist at build time.
npm install imagemin-webp-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Shows full plugin configuration with separate rules for JPEG/PNG and GIF images, including all available options.
Always put ImageminWebpWebpackPlugin as the last plugin in your webpack config plugins array.
Use aliases or dynamic requires; refer to css-loader documentation for handling generated assets.
Upgrade to v3 and adjust config to new format (config array, overrideExtension, strict, etc.).
Use silent: false to allow detailedLogs to work.
Set overrideExtension: false if you want image.png.webp instead of image.webp.
npm install imagemin-webp imagemin-gif2webp --save-dev
Use const ImageminWebpWebpackPlugin = require('imagemin-webp-webpack-plugin'); or use default import with ES module interop.Wrap options in config: [{ test: /regex/, options: {...} }]Set strict: false to allow build to continue, or fix the problematic image file.
No dependency data recorded yet.