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 · Dec 6, 2026

vite-css-modules has 169,945 recorded weekly downloads on npm, an increase of 24.3% over the past 30 days, ranking #551 of 3,247 tracked listings.

Weekly downloads
169,945
Official API · Dec 5, 2026
7-day growth
+0.2%
+409 weekly downloads
30-day growth
+24.3%
+33.2K weekly downloads
90-day growth
+217%
+116.3K weekly downloads
Rank
#551
▼ 11 in 7 days

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

7/30/90-day growth

vite-css-modules weekly downloads growth on npm: +0.2% over 7 days, +24.3% over 30 days, +217% over 90 days.vite-css-modulesWeekly downloads growth on npm169,945downloads / week now7-day growth+409 weekly downloads+0.2%30-day growth+33,246 weekly downloads+24.3%90-day growth+116,251 weekly downloads+217%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
vite-css-modules weekly downloads growth on npm: +0.2% over 7 days, +24.3% over 30 days, +217% over 90 days.

Ranking history

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

Listing placement

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

Listing placement

Vite plugins300 listings · 15 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 (592)
Recent weekly downloads observations for vite-css-modules
Date (UTC)Weekly downloadsChange vs. previous
169,945-1.7K
171,642+5.8K
165,844+4.5K
161,337+1.4K
159,945-3K
162,968-5.2K
168,167-1.4K
169,536-2.7K
172,236-2.9K
175,153+32
175,121+1.9K
173,268+5.7K
167,577+7.1K
160,477—

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