Webpack loader and plugin to optimize (compress) images using imagemin, sharp, or svgo. Current stable version is 5.0.0 (released 2026-03-03), with a release cadence of major versions approximately yearly. It supports multiple backends for image optimization: imagemin (traditional), sharp (high-performance), svgo (for SVGs), and the deprecated squoosh. Key differentiators include integration as both a loader and plugin, support for generation of alternative formats (webp, avif), and filtering per minimizer. It has shipped TypeScript types and requires Node.js >=20.9.0 and webpack ^5.1.0.
npm install image-minimizer-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Basic webpack config with ImageMinimizerPlugin using imagemin and jpegtran/optipng plugins.
Upgrade Node.js to >=20.9.0 or stay on v4.x.
Upgrade Node.js to >=18.12.0 or stay on v3.x.
Use sharp or imagemin instead.
Explicitly set concurrency if defaults are not optimal.
Upgrade to >=4.1.4 or clear cache.
npm install imagemin imagemin-jpegtran imagemin-optipng (or other plugins)
Use default import: import ImageMinimizerPlugin from 'image-minimizer-webpack-plugin'
Ensure minimizer is an object with implementation and options keys.