vite-plugin-sharp
JSON →A zero-config Vite plugin for compressing images at build time using sharp (JPEG/PNG/WebP/AVIF/TIFF/GIF) and SVGO (SVG). Active, stable v1.6.3 with support for Vite 4+. Works on both bundle-asset and public/ directory images. Outperforms imagemin-based alternatives by 4-5x due to libvips native bindings. Features include content-hash caching, include/exclude filters, min-ratio/size thresholds, resize without enlargement, configurable concurrency, and per-format compression settings. Transparent terminal output showing before/after sizes per file. Ships TypeScript types.
Resources
packagevite-plugin-sharp ↗
API endpoints
full doc /v1/registry/vite-plugin-sharp