An esbuild plugin that automatically minifies images (PNG, JPG, GIF, SVG) during the build process using imagemin. Version 1.0.1 is the latest stable release, supports both CJS and ESM imports, and provides TypeScript type definitions. It bundles several popular imagemin plugins (mozjpeg, gifsicle, pngquant, svgo) by default, with options to disable individual ones, configure their options, or add custom imagemin plugins. This plugin differentiates itself by integrating seamlessly with esbuild's build pipeline, requiring no additional loaders or configuration beyond adding the plugin.
npm install esbuild-plugin-imageminNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup of esbuild with the imagemin plugin enabled, using ESM imports and async build.
Use imageminPlugin() instead of imageminPlugin in the plugins array.
Review default plugins and use disableDefaultPlugins if needed.
Ensure images are imported in your source files.
Upgrade to v1.0.1 to get built-in TypeScript support.
npm install imagemin
Change to imageminPlugin()
Ensure entry points are files, not directories.