Skip to content
PluginStats

vite-css-modules weekly downloads statistics

By privatenumber (2 listings) · npm · Vite plugins

Vite plugin for correct CSS Modules behavior

View on npm Fresh · Oct 18, 2026

vite-css-modules has 58,494 recorded weekly downloads on npm, a decrease of 5.3% over the past 30 days, ranking #561 of 2,322 tracked listings.

Weekly downloads
58,494
Official API · Oct 18, 2026
7-day growth
-36.4%
-33.4K weekly downloads
30-day growth
-5.3%
-3.3K weekly downloads
90-day growth
-27.3%
-21.9K weekly downloads
Rank
#561
Among tracked npm listings

About vite-css-modules

vite-css-modules <a href="https://npm.im/vite-css-modules"><img src="https://badgen.net/npm/v/vite-css-modules"></a> <a href="https://npm.im/vite-css-modules"><img src="https://badgen.net/npm/dm/vite-css-modules"></a>

Vite plugin to fix broken CSS Modules handling.

→ Play with a demo on StackBlitz

[!NOTE] We're working to integrate this fix directly into Vite (PR #16018). Until then, use this plugin to benefit from these improvements now.

<br> <p align="center"> <a href="https://github.com/sponsors/privatenumber/sponsorships?tier_id=398771"><img width="412" src="https://raw.githubusercontent.com/privatenumber/sponsors/master/banners/assets/donate.webp"></a> <a href="https://github.com/sponsors/privatenumber/sponsorships?tier_id=416984"><img width="412" src="https://raw.githubusercontent.com/privatenumber/sponsors/master/banners/assets/sponsor.webp"></a> </p> <br>

Why use this plugin?

Have you encountered any of these Vite CSS Module bugs? They're happening because Vite's CSS Modules implementation delegates everything to postcss-modules, creating a black box that Vite can't see into.

This plugin fixes these issues by properly integrating CSS Modules into Vite's build pipeline.

The bugs this fixes
<details> <summary>1. PostCSS plugins don't apply to <code>composes</code> dependencies</summary><br>

When you use composes to import classes from another CSS file, Vite's PostCSS plugins never process the imported file. This means your PostCSS transformations, auto-prefixing, or custom plugins are silently skipped for dependencies.

What happens in Vite:

  • style.module.css gets processed by PostCSS ✓
  • utils.css does NOT get processed by PostCSS ✗
  • Your PostCSS plugin never sees utils.css because postcss-modules bundles it internally

With this plugin:

  • Both files go through your PostCSS pipeline correctly

Vite issue #10079, #10340 | Test case

</details> <details> <summary>2. Shared classes get duplicated in your bundle</summary><br>

When multiple CSS Modules compose from the same utility file, the utility's styles get bundled multiple times. This increases bundle size and can cause style conflicts.

Example:

/* utils.css */
.button { padding: 10px; }

/* header.module.css */
.title { composes: button from './utils.css'; }

/* footer.module.css */
.link { composes: button from './utils.css'; }

What happens in Vite:

/* Final bundle contains .button styles TWICE */
.button { padding: 10px; }  /* from header.module.css */
.button { padding: 10px; }  /* from footer.module.css - duplicated! */

With this plugin:

/* Final bundle contains .button styles ONCE */
.button { padding: 10px; }  /* deduplicated */

Vite issue #7504, #15683 | Test case

</details> <details> <summary>3. Missing <code>composes</code> classes fail silently</summary><br>

If you typo a class name in composes, Vite doesn't error. Instead, it outputs undefined in your class names, breaking your UI with no warning.

Example:

.button {
  composes: nonexistant from './utils.css';  /* Typo! */
}

What happens in Vite:

import styles from './style.module.css'

console.log(styles.button) // "_button_abc123 undefined" - no error!

With this plugin:

Error: Cannot find class 'nonexistent' in './utils.css'

Vite issue #16075 | Test case

</details> <details> <summary>4. Can't compose between CSS and SCSS</summary><br>

Trying to compose from SCSS/Sass files causes syntax errors because postcss-modules tries to parse SCSS as plain CSS.

Example:

/* base.module.scss */
.container { display: flex; }
/* style.module.css */
.wrapper { composes: container from './base.module.scss'; }

What happens in Vite:

CssSyntaxError: Unexpected '/'

With this plugin:

  • Works correctly because each file goes through its proper preprocessor first

Vite issue #10340 | Test case

</details> <details> <summary>5. HMR doesn't work properly</summary><br>

Changing a CSS Module file causes a full page reload instead of a hot update, losing component state.

What happens in Vite:

  • Full page reload on CSS Module changes

With this plugin:

  • CSS Module changes update instantly without losing component state

Vite issue #16074 | Test case

</details> <details> <summary>6. Reserved JavaScript keywords break exports</summary><br>

Using JavaScript reserved keywords as class names (like .import, .export) generates invalid JavaScript code.

Example:

.import { color: red; }
.export { color: blue; }

What happens in Vite:

// Tries to generate invalid JavaScript:
export const import = "...";  // Syntax error "import" is reserved!
export const export = "...";  // Syntax error "export" is reserved!

With this plugin:

  • Properly handles reserved keywords in class names…

Description from the npm listing.

  • vite
  • plugin
  • vite-plugin
  • css modules
  • patch

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-css-modules weekly downloads on npm, last 90 days: 58,494 weekly downloads as of Oct 18, 2026, -27.3% over 90 days.vite-css-modulesWeekly downloads on npm · Last 90 days58,494downloads / week-27.3% over 90 days020K40K60K80K100K120KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
vite-css-modules weekly downloads on npm, last 90 days: 58,494 weekly downloads as of Oct 18, 2026, -27.3% over 90 days.

7/30/90-day growth

vite-css-modules weekly downloads growth on npm: -36.4% over 7 days, -5.3% over 30 days, -27.3% over 90 days.vite-css-modulesWeekly downloads growth on npm58,494downloads / week now7-day growth-33,412 weekly downloads-36.4%30-day growth-3,291 weekly downloads-5.3%90-day growth-21,940 weekly downloads-27.3%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
vite-css-modules weekly downloads growth on npm: -36.4% over 7 days, -5.3% over 30 days, -27.3% over 90 days.

Ranking history

vite-css-modules npm ranking history: currently #561 (by weekly downloads).vite-css-modulesnpm ranking · by weekly downloads · Last 90 days#561current rank#150#200#250#300#350#400#450#500#550#600Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 17, 2026 – Oct 20, 2026 · 4 observations · Updated Oct 18, 2026pluginstats.com
vite-css-modules npm ranking history: currently #561 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,161 shown · page 29, #1 (overall #561)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins253 listings · 13 pages · page 5, #3 (overall #83)
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 (544)
Recent weekly downloads observations for vite-css-modules
Date (UTC)Weekly downloadsChange vs. previous
58,494+8.3K
50,223-3.9K
54,118+5.5K
48,619-21.2K
69,823-22.2K
92,0620
92,062+156
91,906+59
91,847-773
92,620+3
92,617+41
92,576-977
93,553-20.8K
114,381—

Similar npm Vite plugins plugins

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