vite-plugin-purgecss weekly downloads statistics
By colecrouter · npm · Vite plugins
PurgeCSS plugin for Vite
vite-plugin-purgecss has 9,870 recorded weekly downloads on npm, a decrease of 15.7% over the past 30 days, ranking #909 of 2,256 tracked listings.
About vite-plugin-purgecss
Fork of vite-plugin-html-purgecss
vite-plugin-purgecss
This Vite plugin automatically removes unused CSS based on HTML & JS output using PurgeCSS.
• Lightweight install and runtime environment •
Install
npm
Usage
Configuration
Use plugin in your Vite config (vite.config.ts)
Usage with Javascript and non-HTML frameworks
When using frameworks that don't export to HTML (or settings styles via JS), PurgeCSS typically doesn't find anything. To fix this, I've hardcoded the plugin to feed JS code into PurgeCSS (instead of just HTML) to scan for any inlined CSS strings.
This isn't a perfect solution, as it doesn't catch explicit style changes (x.style.color = 'red';). This could potentially be resolved with FullHuman/purgecss-from-js, but it uses CJS which is incompatible with Vite. A better solution might present itself later on.
That being said, this solution should work with most frameworks. It should even work better than a normal PurgeCSS CLI pass. I tested with SvelteKit with @sveltejs/adapter-cloudflare, and it worked flawlessly.
Options
Optionally supply a UserDefinedOptions as you would with PurgeCSS.
If some of your CSS classes aren't making it to the final output, try adding them to safelist in the options object.
An example of this would be Popovers in Bootstrap. Sometimes, the arrow on popovers won't be picked up by PurgeCSS, so I might set:
to manually whitelist all Popover related classes.
Description from the npm listing.
- vite
- vite-plugin
- purgecss
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
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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 (542)Similar npm Vite plugins plugins
All 20 vite-plugin-purgecss alternativesData 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-purgecss. First seen Oct 16, 2026; last successful collection Oct 19, 2026. See the methodology.