Skip to content
PluginStats

vite-plugin-optimize-css-modules weekly downloads statistics

By simonwep · npm · Vite plugins

Mangles the classnames generated by postcss-modules in vite

View on npm Fresh · Dec 6, 2026

vite-plugin-optimize-css-modules has 84,897 recorded weekly downloads on npm, an increase of 143% over the past 30 days, ranking #663 of 3,247 tracked listings.

Weekly downloads
84,897
Official API · Dec 5, 2026
7-day growth
-36.9%
-49.6K weekly downloads
30-day growth
+143%
+50K weekly downloads
90-day growth
+420%
+68.6K weekly downloads
Rank
#663
▼ 87 in 7 days

About vite-plugin-optimize-css-modules

<br/> <h3 align="center"> <p>Vite Plugin - Optimize CSS Modules</p> </h3> <h6 align="center"> <p><a href="#how-does-it-work">Mangle classnames in production</a> - save up to 30% on css and 90% of build time for free!</p> </h6> <p align="center"> <a href="https://github.com/Simonwep/vite-plugin-optimize-css-modules/actions/workflows/main.yml"><img alt="CI Status" src="https://github.com/Simonwep/vite-plugin-optimize-css-modules/actions/workflows/main.yml/badge.svg"/></a> <a href="https://www.npmjs.com/package/vite-plugin-optimize-css-modules"><img alt="Install count" src="https://img.shields.io/npm/dm/vite-plugin-optimize-css-modules.svg"></a> <img alt="Current version" src="https://img.shields.io/github/tag/Simonwep/vite-plugin-optimize-css-modules.svg?color=3498DB&label=version"> <a href="https://github.com/sponsors/Simonwep"><img alt="Support me" src="https://img.shields.io/badge/github-support-3498DB.svg"></a> </p>
Setup

This plugin requires vite of v3 or greater. It only makes sense to use if you're using css modules.

$ npm install --save-dev vite-plugin-optimize-css-modules

In your vite.config.ts simply add the plugin:

import { optimizeCssModules } from 'vite-plugin-optimize-css-modules';
import { defineConfig } from 'vite';

export default defineConfig({
    plugins: [
        optimizeCssModules()
    ]
})

And that's it. When running vite build your generated CSS should be significantly smaller.

Benchmarks

Benchmarks are done against bootstrap and materialize.css assuming all the classes are used as css modules. The benchmark code is located in the benchmarks directory.

Run them by building the plugin via npm run build and then running npm run benchmarks. The results below are from a MacBook Air M2 with node v22.8.0, ran on the 31th December 2024.

InputBuild TimeGzip SizeBrotli Size
bootstrap-5.0.2.module.css525ms (-94.06% / -8311ms)21.3 kB (-26.53% / -7.69 kB)21.3 kB (-27.54% / -6 kB)
materialize-1.0.0.module.css572ms (-92.59% / -7156ms)20.1 kB (-19.70% / -4.93 kB)20.1 kB (-21.33% / -4.3 kB)
How does it work?

By default, when using css modules, you end up with hashes or other long class-names in your bundled css files:

@keyframes _close-card_pzatx_1 {
    /* ...css */
}

._card_pzatx_32 {
    /* ...css */
}

._back_pzatx_49 ._content_pzatx_70 ._close_pzatx_74 {
    /* ...css */
}

By using this module, the smalles possible classname will be used for each "id":

@keyframes a {
    /* ...css */
}

.v {
    /* ...css */
}

.c .s .w {
    /* ...css */
}

Description from the npm listing.

  • vite
  • vite-plugin
  • css-modules
  • css
  • minify

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-optimize-css-modules weekly downloads on npm, last 90 days: 84,897 weekly downloads as of Dec 5, 2026, +420% over 90 days.vite-plugin-optimize-css-modulesWeekly downloads on npm · Last 90 days84,897downloads / week+420% over 90 days020K40K60K80K100K120K140KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
vite-plugin-optimize-css-modules weekly downloads on npm, last 90 days: 84,897 weekly downloads as of Dec 5, 2026, +420% over 90 days.

7/30/90-day growth

vite-plugin-optimize-css-modules weekly downloads growth on npm: -36.9% over 7 days, +143% over 30 days, +420% over 90 days.vite-plugin-optimize-css-modulesWeekly downloads growth on npm84,897downloads / week now7-day growth-49,619 weekly downloads-36.9%30-day growth+50,020 weekly downloads+143%90-day growth+68,575 weekly downloads+420%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-plugin-optimize-css-modules weekly downloads growth on npm: -36.9% over 7 days, +143% over 30 days, +420% over 90 days.

Ranking history

vite-plugin-optimize-css-modules npm ranking history: currently #663 (by weekly downloads).vite-plugin-optimize-css-modulesnpm ranking · by weekly downloads · Last 90 days#663current rank#200#300#400#500#600#700#800#900Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
vite-plugin-optimize-css-modules npm ranking history: currently #663 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 34, #3 (overall #663)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 6, #9 (overall #109)
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 (591)
Recent weekly downloads observations for vite-plugin-optimize-css-modules
Date (UTC)Weekly downloadsChange vs. previous
84,897-16.1K
101,004-17.9K
118,946-17.8K
136,761-1.9K
138,628+1.6K
137,058+2.2K
134,891+375
134,516-191
134,707+2K
132,739+1.7K
131,016+2.8K
128,202+2.8K
125,419+2.5K
122,893—

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-optimize-css-modules. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.