Webpack loader that minifies PNG, JPEG, GIF, SVG and WEBP images using imagemin. Version 8.1.0 bundles optimizers for mozjpeg, optipng, pngquant, svgo, gifsicle, and optionally webp. Active development, new releases every few months. Key differentiator: seamless integration with webpack pipeline, automatic optimization on build. Compared to standalone imagemin, this plugin integrates directly into the webpack build process and allows per-rule configuration.
npm install image-webpack-loaderVerified import paths — ran on the pinned version, not inferred.
Configures webpack to minify images with image-webpack-loader, chained after file-loader, with custom options for each optimizer.
Add 'file-loader' before 'image-webpack-loader' in the use array.
Use options: { disable: true } instead of bypassOnDebug.Ensure libwebp is installed or disable webp optimizer.
Use Node 12 LTS; for other versions, consider using image-minimizer-webpack-plugin.
Install build tools: on macOS 'xcode-select --install', on Ubuntu 'apt-get install build-essential'.
Set options: { svgo: { plugins: [{ removeViewBox: false }] } } or disabled: true.Run 'brew install libpng'.
Run 'npm install image-webpack-loader --save-dev' again, or manually install imagemin.
Replace with options: { disable: true }.Add 'file-loader' to the use array before 'image-webpack-loader'.