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 Fresh · Oct 18, 2026

vite-plugin-image-optimizer has 140,674 recorded weekly downloads on npm, a decrease of 42.7% over the past 30 days, ranking #432 of 2,322 tracked listings.

Weekly downloads
140,674
Official API · Oct 18, 2026
7-day growth
-42.9%
-105.6K weekly downloads
30-day growth
-42.7%
-104.9K weekly downloads
90-day growth
-43.6%
-108.7K weekly downloads
Rank
#432
Among tracked npm listings

About vite-plugin-image-optimizer

<div align="center"> <a href="https://vitejs.dev/"> <img width="200" height="200" hspace="10" src="https://vitejs.dev/logo.svg" alt="vite logo" /> </a> <h1>Vite Image Optimizer</h1> <p> Plugin for <a href="https://vitejs.dev/">Vite</a> to optimize all images assets using <a href="https://github.com/lovell/sharp">Sharp.js</a> and <a href="https://github.com/svg/svgo">SVGO</a> at build time. </p> <img src="https://img.shields.io/node/v/vite-plugin-image-optimizer" alt="node-current" /> <img src="https://img.shields.io/npm/dependency-version/vite-plugin-image-optimizer/peer/vite" alt="npm peer dependency version" /> <img src="https://img.shields.io/bundlephobia/minzip/vite-plugin-image-optimizer?label=minfied" alt="npm bundle size"/> <img src="https://img.shields.io/github/v/release/fatehak/vite-plugin-image-optimizer" alt="GitHub release" /> <img src="https://img.shields.io/npm/l/vite-plugin-image-optimizer" alt="licence" /> </div> <p>&nbsp;</p>

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) terminal output image

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

npm install vite-plugin-image-optimizer --save-dev

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.

npm install sharp --save-dev
npm install svgo --save-dev

Usage

import { ViteImageOptimizer } from 'vite-plugin-image-optimizer';
import { defineConfig } from 'vite';

export default defineConfig(() => {
  return {
    plugins: [
      ViteImageOptimizer({
        /* pass your config */
      }),
    ],
  };
});

Default Configuration

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

const DEFAULT_OPTIONS = {
  logStats: true,
  ansiColors: true,
  test: /\.(jpe?g|png|gif|tiff|webp|svg|avif)$/i,
  exclude: undefined,
  include: undefined,
  includePublic: true,
  svg: {
    multipass: true,
    plugins: [
      {
        name: 'preset-default',
        params: {
          overrides: {
            cleanupNumericValues: false,
            cleanupIds: {
              minify: false,
              remove: false,
            },
            convertPathData: false,
          },
        },
      },
      'sortAttrs',
      {
        name: 'addAttributesToSVGElement',
        params: {
          attributes: [{ xmlns: 'http://www.w3.org/2000/svg' }],
        },
      },
    ],
  },
  png: {
    // https://sharp.pixelplumbing.com/api-output#png
    quality: 100,
  },
  jpeg: {
    // https://sharp.pixelplumbing.com/api-output#jpeg
    quality: 100,
  },
  jpg: {
    // https://sharp.pixelplumbing.com/api-output#jpeg
    quality: 100,
  },
  tiff: {
    // https://sharp.pixelplumbing.com/api-output#tiff
    quality: 100,
  },
  // gif does not support lossless compression
  // https://sharp.pixelplumbing.com/api-output#gif
  gif: {},
  webp: {
    // https://sharp.pixelplumbing.com/api-output#webp
    lossless: true,
  },
  avif: {
    // https://sharp.pixelplumbing.com/api-output#avif
    lossless: true,
  },
  cache: false,
  cacheLocation: undefined,
};

Plugin Options

test

Type: RegExp

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

Test to match files against.

exclude

Type: String | RegExp | Array<string>

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<string>

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…

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: 140,674 weekly downloads as of Oct 18, 2026, -43.6% over 90 days.vite-plugin-image-optimizerWeekly downloads on npm · Last 90 days140,674downloads / week-43.6% over 90 days100K150K200K250K300K350KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
vite-plugin-image-optimizer weekly downloads on npm, last 90 days: 140,674 weekly downloads as of Oct 18, 2026, -43.6% over 90 days.

7/30/90-day growth

vite-plugin-image-optimizer weekly downloads growth on npm: -42.9% over 7 days, -42.7% over 30 days, -43.6% over 90 days.vite-plugin-image-optimizerWeekly downloads growth on npm140,674downloads / week now7-day growth-105,559 weekly downloads-42.9%30-day growth-104,863 weekly downloads-42.7%90-day growth-108,658 weekly downloads-43.6%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
vite-plugin-image-optimizer weekly downloads growth on npm: -42.9% over 7 days, -42.7% over 30 days, -43.6% over 90 days.

Ranking history

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

Listing placement

All npm2,320 listings · 116 pages · 1,162 shown · page 22, #12 (overall #432)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins253 listings · 13 pages · page 3, #16 (overall #56)
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 (122)
Recent weekly downloads observations for vite-plugin-image-optimizer
Date (UTC)Weekly downloadsChange vs. previous
140,674+20.8K
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—

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 20, 2026. See the methodology.