vite-plugin-optimize-css-modules weekly downloads statistics
By simonwep · npm · Vite plugins
Mangles the classnames generated by postcss-modules in vite
vite-plugin-optimize-css-modules has 14,239 recorded weekly downloads on npm, a decrease of 22.9% over the past 30 days.
It ranks #836 of 2,251 tracked npm listings by weekly downloads.
Over 90 days, weekly downloads changed by +6.1%.
PluginStats has 542 daily observations since Apr 24, 2025; the latest is from Oct 17, 2026.
About vite-plugin-optimize-css-modules
Vite Plugin - Optimize CSS Modules
Mangle classnames in production - save up to 30% on css and 90% of build time for free!
Setup
This plugin requires vite of v3 or greater. It only makes sense to use if you're using css modules.
In your vite.config.ts simply add the plugin:
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.
| Input | Build Time | Gzip Size | Brotli Size |
| bootstrap-5.0.2.module.css | 525ms (_-94.06%_ / _-8311ms_) | 21.3 kB (_-26.53%_ / _-7.69 kB_) | 21.3 kB (_-27.54%_ / _-6 kB_) | | materialize-1.0.0.module.css | 572ms (_-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:
By using this module, the smalles possible classname will be used for each "id":
Description from the npm listing.
- vite
- vite-plugin
- css-modules
- css
- minify
Where vite-plugin-optimize-css-modules sits in the listing
Each band is one page of 20. Weekly downloads on a log 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.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
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.
Recent observations
Full history (542)Similar npm Vite plugins plugins
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 Oct 18, 2026. See the methodology.