Skip to content
PluginStats

purgecss-webpack-plugin weekly downloads statistics

By FullHuman · npm · Webpack plugins

PurgeCSS plugin for webpack and Rspack - Remove unused css

View on npm Fresh · Dec 6, 2026

purgecss-webpack-plugin has 52,969 recorded weekly downloads on npm, a decrease of 7.0% over the past 30 days, ranking #762 of 3,247 tracked listings.

Weekly downloads
52,969
Official API · Dec 5, 2026
7-day growth
-1.7%
-901 weekly downloads
30-day growth
-7.0%
-4K weekly downloads
90-day growth
+8.4%
+4.1K weekly downloads
Rank
#762
▼ 21 in 7 days

About purgecss-webpack-plugin

purgecss-webpack-plugin

npm license

webpack and Rspack plugin to remove unused css.

Install

npm i purgecss-webpack-plugin -D

Usage

With mini-css-extract-plugin
const path = require("path");
const glob = require("glob");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { PurgeCSSPlugin } = require("purgecss-webpack-plugin");

const PATHS = {
  src: path.join(__dirname, "src"),
};

module.exports = {
  entry: "./src/index.js",
  output: {
    filename: "bundle.js",
    path: path.join(__dirname, "dist"),
  },
  optimization: {
    splitChunks: {
      cacheGroups: {
        styles: {
          name: "styles",
          test: /\.css$/,
          chunks: "all",
          enforce: true,
        },
      },
    },
  },
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [MiniCssExtractPlugin.loader, "css-loader"],
      },
    ],
  },
  plugins: [
    new MiniCssExtractPlugin({
      filename: "[name].css",
    }),
    new PurgeCSSPlugin({
      paths: glob.sync(`${PATHS.src}/**/*`, { nodir: true }),
    }),
  ],
};
With Rspack

The plugin works with Rspack as well, without webpack installed: it uses the classes of the bundler running it, and its TypeScript declarations do not depend on webpack. Use it with CssExtractRspackPlugin, or with the native CSS support of Rspack (type: "css/auto"). The tests run with Rspack 2. With Rspack 1, the used classes of CSS modules are kept from Rspack 1.1 on with CssExtractRspackPlugin, and from Rspack 1.3 on with the native CSS support; with older versions, the CSS modules are purged as in purgecss-webpack-plugin 9.0, which removes their hashed class names.

const path = require("path");
const glob = require("glob");
const { rspack } = require("@rspack/core");
const { PurgeCSSPlugin } = require("purgecss-webpack-plugin");

module.exports = {
  entry: "./src/index.js",
  module: {
    rules: [
      {
        test: /\.css$/,
        use: [rspack.CssExtractRspackPlugin.loader, "css-loader"],
        type: "javascript/auto",
      },
    ],
  },
  plugins: [
    new rspack.CssExtractRspackPlugin(),
    new PurgeCSSPlugin({
      paths: glob.sync(`${path.join(__dirname, "src")}/**/*`, { nodir: true }),
    }),
  ],
};
With Next.js

Next.js 16 builds with Turbopack by default, which does not run webpack plugins. Build with webpack to use the plugin: next build --webpack (and next dev --webpack), with the plugin added in the webpack function of next.config.js.

How the CSS is purged

The plugin purges the CSS assets of the chunks at the PROCESS_ASSETS_STAGE_ADDITIONAL stage of the processAssets hook, the stage of the deprecated additionalAssets hook it used before. Plugins that derive assets from the CSS at a later stage (e.g. a right-to-left copy at PROCESS_ASSETS_STAGE_DERIVED) read the purged CSS, and the CSS is purged before CSS minimizers (PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE), source map extraction and content hashing.

The content files of paths are read and their selectors extracted once per compilation, for all the CSS assets. In watch mode (--watch, webpack-dev-server, rspack dev), the content files are watched: a change to one of them triggers a new compilation, even if it is not imported by the JavaScript code, and only the files that changed since the previous compilation are read and extracted again. The directories are not watched: when paths is a function, a new file is part of the content from the next compilation on, once something else triggered it. A content file that does not exist is reported as an error of the compilation, and the compilation runs again once the file is created.

The watcher of the bundler applies its own options to the content files. When a content file is a symbolic link, e.g. a file of a workspace package linked in node_modules, the plugin watches its target as well, as the watchers do not follow symbolic links by default (watchOptions.followSymlinks). Rspack ignores the changes to the files of node_modules by default (watchOptions.ignored), the content files included.

With webpack-dev-server, the CSS is purged again when only a content file outside the module graph changed (e.g. an HTML template), but the hash of the compilation is the same, so webpack-dev-server does not tell the browser: reload the page to see the new CSS. With Rspack, the hash changes.

When the webpack devtool option generates source maps, the source maps of the purged CSS keep pointing to the original CSS files.

CSS modules

The class names of CSS modules are hashed (.modUsed becomes .card-module__modUsed--VlNeS), while the content uses the name of the export (styles.modUsed). The plugin reads the export map of each CSS module of the purged chunks and keeps the hashed class names whose export name is found in the content, along with the classes they compose. The other classes of the CSS modules are removed, like unused global classes.

The export maps are read from:

  • the JavaScript module that mini-css-extract-plugin or CssExtractRspackPlugin generates for a CSS module (css-loader with modules), with a default export or named exports;
  • the JavaScript code generated by the native CSS support of Rspack (type: "css/auto"). In production, with optimization.usedExports, Rspack only generates the exports used by the JavaScript code, possibly under mangled names: they are all kept;
  • the exports of the native CSS support of webpack 5.97 or later (experiments.css with type: "css/auto"). With older versions, used classes of the CSS modules may be removed.…

Description from the npm listing.

  • webpack-plugin
  • rspack-plugin
  • optimize
  • optimization
  • remove
  • unused
  • css
  • html
  • rules
  • purge
  • uncss
  • purify

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

purgecss-webpack-plugin weekly downloads on npm, last 90 days: 52,969 weekly downloads as of Dec 5, 2026, +8.4% over 90 days.purgecss-webpack-pluginWeekly downloads on npm · Last 90 days52,969downloads / week+8.4% over 90 days010K20K30K40K50K60KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
purgecss-webpack-plugin weekly downloads on npm, last 90 days: 52,969 weekly downloads as of Dec 5, 2026, +8.4% over 90 days.

7/30/90-day growth

purgecss-webpack-plugin weekly downloads growth on npm: -1.7% over 7 days, -7.0% over 30 days, +8.4% over 90 days.purgecss-webpack-pluginWeekly downloads growth on npm52,969downloads / week now7-day growth-901 weekly downloads-1.7%30-day growth-4,005 weekly downloads-7.0%90-day growth+4,127 weekly downloads+8.4%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
purgecss-webpack-plugin weekly downloads growth on npm: -1.7% over 7 days, -7.0% over 30 days, +8.4% over 90 days.

Ranking history

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

Listing placement

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

Listing placement

Webpack plugins349 listings · 18 pages · page 1, #16 (overall #16)
Webpack 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 purgecss-webpack-plugin
Date (UTC)Weekly downloadsChange vs. previous
52,969-373
53,342+687
52,655+1.1K
51,576-686
52,262-43
52,305-605
52,910-960
53,870-88
53,958-1.6K
55,534-920
56,454-373
56,827-18
56,845+914
55,931—

Similar npm Webpack plugins plugins

All 20 purgecss-webpack-plugin 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/purgecss-webpack-plugin. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.