Skip to content
PluginStats

cssnano-webpack-plugin weekly downloads statistics

By lneveu · npm · Webpack plugins

cssnano plugin for Webpack

View on npm Fresh · Dec 6, 2026

cssnano-webpack-plugin has 310 recorded weekly downloads on npm, a decrease of 52.3% over the past 30 days, ranking #2378 of 3,247 tracked listings.

Weekly downloads
310
Official API · Dec 5, 2026
7-day growth
-13.4%
-48 weekly downloads
30-day growth
-52.3%
-340 weekly downloads
90-day growth
-8.8%
-30 weekly downloads
Rank
#2378
▼ 138 in 7 days

About cssnano-webpack-plugin

cssnano-webpack-plugin

npm Build Status

This plugin uses cssnano to optimize and minify your CSS.

Fully integrated in Webpack ecosystem: based on compiler hooks, respecting default Webpack output sources and compatible with other plugins like SourceMapDevToolPlugin or webpack-subresource-integrity.

Just like optimize-css-assets-webpack-plugin but more accurate with source maps and assets using query string.

Works with Webpack 4+.

Getting Started

First, install cssnano-webpack-plugin:

$ npm install cssnano-webpack-plugin --save-dev

Then add the plugin to your webpack configuration. For example:

webpack.config.js

const CssnanoPlugin = require('cssnano-webpack-plugin');

module.exports = {
  module: {
    loaders: [
      {
        test: /.s?css$/,
        use: [
          MiniCssExtractPlugin.loader,
          'css-loader',
          'sass-loader'
        ]
      }
    ]
  },
  optimization: {
    minimizer: [
      new CssnanoPlugin()
    ]
  }
};

This will enable CSS optimization only in production mode. If you want to run it also in development, put the plugin configuration in the plugins option array.

Options

test

Type: String|RegExp|Array<String|RegExp> - default: /\.css(\?.*)?$/i

Test to match files against.

module.exports = {
  optimization: {
    minimizer: [
      new CssnanoPlugin({
        test: /\.foo\.css$/i
      })
    ]
  }
};

include and exclude options are also supported (see module rules).

sourceMap

Type: Boolean|Object - default: false

Enable (and configure) source map support. Use PostCss SourceMap options. Default configuration when enabled: { inline: false }.

module.exports = {
  optimization: {
    minimizer: [
      new CssnanoPlugin({
        sourceMap: true
      })
    ]
  }
};
cssnanoOptions

Type: Object - default: { preset: 'default' }

Cssnano optimisations options.

module.exports = {
  optimization: {
    minimizer: [
      new CssnanoPlugin({
        cssnanoOptions: {
          preset: ['default', {
            discardComments: { removeAll: true }
          }]
        }
      })
    ]
  }
};

Examples

Use sourcemaps

Don't forget to enable sourceMap options for all loaders.

const CssnanoPlugin = require('cssnano-webpack-plugin');

module.exports = {
  module: {
    loaders: [
      {
        test: /.s?css$/,
        use: [
          MiniCssExtractPlugin.loader,
          { loader: 'css-loader', options: { sourceMap: true } },
          { loader: 'sass-loader', options: { sourceMap: true } }
        ]
      }
    ]
  },
  optimization: {
    minimizer: [
      new CssnanoPlugin({
        sourceMap: true
      })
    ]
  }
};
Remove all comments

Remove all comments (including comments starting with /*!).

module.exports = {
  optimization: {
    minimizer: [
      new CssnanoPlugin({
        cssnanoOptions: {
          preset: ['default', {
            discardComments: { removeAll: true }
          }]
        }
      })
    ]
  }
};

License

MIT

Description from the npm listing.

  • cssnano
  • css
  • webpack
  • webpack-plugin
  • minimize
  • minimizer
  • minify
  • minifier
  • optimize
  • optimizer

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

cssnano-webpack-plugin weekly downloads on npm, last 90 days: 310 weekly downloads as of Dec 5, 2026, -8.8% over 90 days.cssnano-webpack-pluginWeekly downloads on npm · Last 90 days310downloads / week-8.8% over 90 days0200400600800Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
cssnano-webpack-plugin weekly downloads on npm, last 90 days: 310 weekly downloads as of Dec 5, 2026, -8.8% over 90 days.

7/30/90-day growth

cssnano-webpack-plugin weekly downloads growth on npm: -13.4% over 7 days, -52.3% over 30 days, -8.8% over 90 days.cssnano-webpack-pluginWeekly downloads growth on npm310downloads / week now7-day growth-48 weekly downloads-13.4%30-day growth-340 weekly downloads-52.3%90-day growth-30 weekly downloads-8.8%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
cssnano-webpack-plugin weekly downloads growth on npm: -13.4% over 7 days, -52.3% over 30 days, -8.8% over 90 days.

Ranking history

cssnano-webpack-plugin npm ranking history: currently #2378 (by weekly downloads).cssnano-webpack-pluginnpm ranking · by weekly downloads · Last 90 days#2378current rank#500#1000#1500#2000#2500Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
cssnano-webpack-plugin npm ranking history: currently #2378 (by weekly downloads).

Listing placement

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

Listing placement

Webpack plugins349 listings · 18 pages · page 7, #1 (overall #121)
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 cssnano-webpack-plugin
Date (UTC)Weekly downloadsChange vs. previous
310+23
287+16
271-18
289-51
340-28
368+13
355-3
358-9
367+12
355-12
367+26
341+62
279+13
266—

Similar npm Webpack plugins plugins

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