Skip to content
PluginStats

vite-plugin-image-optimizer weekly downloads statistics

By FatehAK · npm · Vite plugins

A Vite plugin to optimize your image assets using Sharp.js and SVGO

View on npm Stale · Oct 17, 2026

vite-plugin-image-optimizer has 119,866 recorded weekly downloads on npm, a decrease of 51.3% over the past 30 days, ranking #433 of 2,256 tracked listings.

Weekly downloads
119,866
Official API · Oct 17, 2026
7-day growth
-50.9%
-124.1K weekly downloads
30-day growth
-51.3%
-126.4K weekly downloads
90-day growth
-52.7%
-133.5K weekly downloads
Rank
#433
Among tracked npm listings

About vite-plugin-image-optimizer

Vite Image Optimizer

Plugin for Vite to optimize all images assets using Sharp.js and SVGO at build time.

Features

• Optimize SVG assets using SVGO and pass custom configs. • Optimize Raster assets (png, jpeg, gif, tiff, webp, avif) using Sharp.js with the option to pass custom configs for each extension type. • Option to process all assets from your public directory defined in the bundler. • Configure test, include, and exclude to filter assets. • Caching support to avoid re-optimization (optional) • Skips processing assets if their optimized size is greater than their original size. • Log the optimization stats showing the before and after size difference, ratio and total savings (optional)

Motivation

This plugin is based on the awesome image-minimizer-webpack-plugin for Webpack. I wanted to combine the optimization capabilities of Sharp.js and SVGO in a single package and I couldn't find a plugin for Vite that could accomplish this. I initially thought of adding squoosh and imagemin support as well but dropped the idea since they are no longer maintained.

If you find the plugin useful, consider showing your support by giving a ⭐

Contributions are most welcome! We follow conventional-commits

Installation

You can add it as a dev dependency to any of the package managers (NPM, Yarn, PNPM)

Supports Vite >=3 and Node >=14

Warning

sharp and svgo don't come installed as part of the package. You will have to install them manually and add it as a dev dependency. This is a design decision so you can choose to skip installing sharp if you only want to optimize svg assets using svgo and vice versa.

Usage

Default Configuration

The default configuration is made for lossless compression of image assets.

Plugin Options

• test • include • exclude • includePublic • logStats • ansiColors • svg • png • jpeg • tiff • gif • webp • avif • cache • cacheLocation

test

Type: RegExp

Default: /.(jpe?g|png|gif|tiff|webp|svg|avif)$/i

Test to match files against.

exclude

Type: String | RegExp | Array

Default: undefined

Files to exclude. RegExp can be used on the source path to exclude a particular folder (exclude: /textures/).

include

Type: String | RegExp | Array

Default: undefined

Files to include. RegExp can be used on the source path to include a particular folder (include: /textures/).

Warning

This will override any options set in test and exclude and has a higher preference. Use this option if you want to include specific assets only.

includePublic

Type: boolean

Default: true

Include all assets within the public directory defined in Vite. When true it will recursively traverse the directory and optimize all the assets.

logStats

Type: boolean

Default: true

Logs the optimization stats to terminal output with file size difference in kB, percent increase/decrease and total savings.

ansiColors

Type: boolean

Default: true

Logs the optimization stats or errors with ansi colors in the terminal. Set it to false for shells that don't support color text.

svg

Type: SVGOConfig

Default:

Config object to pass to SVGO, you can override it with your custom config.

png

Type: PngOptions

Default:

Config object to pass to Sharp.js for assets with png extension

jpeg

Type: JpegOptions

Default:

Config object to pass to Sharp.js for assets with jpg or jpeg extension

gif

Type: GifOptions

Default:

Config object to pass to Sharp.js for assets with gif extension

tiff

Type: TiffOptions

Default:

Config object to pass to Sharp.js for assets with tiff extension

webp

Type: WebpOptions

Default:

Config object to pass to Sharp.js for assets with webp extension

avif

Type: AvifOptions

Default:

Config object to pass to Sharp.js for assets with avif extension

cache

Type: boolean

Default: false

Cache assets in cacheLocation. When enabled, reads and writes asset files with their hash suffix from the specified path.

cacheLocation

Type: String

Default: undefined

Path to the cache directory. Can be used with GitHub Actions and other build servers that support cache directories to speed up consecutive builds.

License

MIT

Description from the npm listing.

  • vite
  • vite-plugin
  • image compression
  • image optimization
  • svgo
  • sharp.js

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

vite-plugin-image-optimizer weekly downloads on npm, last 90 days: 119,866 weekly downloads as of Oct 17, 2026, -52.7% over 90 days.vite-plugin-image-optimizerWeekly downloads on npm · Last 90 days119,866downloads / week-52.7% over 90 days100K150K200K250K300K350KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 17, 2026 · 88 observations · Updated Oc…pluginstats.com
vite-plugin-image-optimizer weekly downloads on npm, last 90 days: 119,866 weekly downloads as of Oct 17, 2026, -52.7% over 90 days.

7/30/90-day growth

vite-plugin-image-optimizer weekly downloads growth on npm: -50.9% over 7 days, -51.3% over 30 days, -52.7% over 90 days.vite-plugin-image-optimizerWeekly downloads growth on npm119,866downloads / week now7-day growth-124,087 weekly downloads-50.9%30-day growth-126,358 weekly downloads-51.3%90-day growth-133,495 weekly downloads-52.7%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
vite-plugin-image-optimizer weekly downloads growth on npm: -50.9% over 7 days, -51.3% over 30 days, -52.7% over 90 days.

Ranking history

vite-plugin-image-optimizer npm ranking history: currently #433 (by weekly downloads).vite-plugin-image-optimizernpm ranking · by weekly downloads · Last 90 days#433current rank#431#432#433#434#435Jul 21Aug 5Aug 20Sep 4Sep 19Oct 4Oct 19rankOct 18, 2026 – Oct 19, 2026 · 2 observations · Updated Oct 17, 2026pluginstats.com
vite-plugin-image-optimizer npm ranking history: currently #433 (by weekly downloads).

Listing placement

All npm2,256 listings · 113 pages · 1,129 shown · page 22, #13 (overall #433)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins250 listings · 13 pages · page 3, #17 (overall #57)
Vite plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (121)
Recent weekly downloads observations for vite-plugin-image-optimizer
Date (UTC)Weekly downloadsChange vs. previous
119,866-21.7K
141,583+4.5K
137,060-54.1K
191,167-51.3K
242,4800
242,480-3.8K
246,233+2.3K
243,953+5.7K
238,254+697
237,557-1.3K
238,829-3.2K
242,062-53K
295,021-891
295,912—

Similar npm Vite plugins plugins

All 20 vite-plugin-image-optimizer alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/vite-plugin-image-optimizer. First seen Oct 16, 2026; last successful collection Oct 19, 2026. See the methodology.