/css-cleanup-webpack-plugin

🖖 Webpack plugin to remove unused css and duplicated css rules. Remove unused css in nuxtjs, gatsbyjs and more...

Primary LanguageJavaScriptMIT LicenseMIT

Build Status license Downloads in week npm version

css-cleanup-webpack-plugin

Remove unused css and duplicated css rules. It detects all unused css rules by looking into all assets on the webpack output dir.

Requirements

This module requires a minimum of Node v6.9.0 and Webpack v4.0.0.

Getting Started

To begin, you'll need to install css-cleanup-webpack-plugin:

$ npm install css-cleanup-webpack-plugin rm-unused-css --save-dev

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

webpack.config.js

const CssCleanupPlugin = require('css-cleanup-webpack-plugin');

module.exports = {
  plugins: [
    new CssCleanupPlugin()
  ]
}

And run webpack via your preferred method.

Donate

Donate with Bitcoin