@evelynlab/webpack-css-treeshaking-plugin

1.1.29 • Public • Published

webpack-css-treeshaking-plugin

Build Status Coverage Status npm package NPM downloads

a webpack plugin to shake unused css code


how to use

npm install webpack-css-treeshaking-plugin -D

config it in your webpack configuration file, it depends on extracting styles to a file, so please use ExtractTextPlugin first.

var ExtractTextPlugin = require('extract-text-webpack-plugin')
const CssTreeShakingPlugin = require("webpack-css-treeshaking-plugin")

module.exports = {
  plugins: [
    new CssTreeShakingPlugin({
      remove: false,
      ignore: ['state-\d']
    }),
    new ExtractTextPlugin({
      filename: 'build/style.css'
    })
  ]
};

configuration

property type default discription
remove boolean false whether to remove unused css
ignore array [] items can be a string or a regexp

architechture

Package Sidebar

Install

npm i @evelynlab/webpack-css-treeshaking-plugin

Weekly Downloads

1

Version

1.1.29

License

MIT

Unpacked Size

614 kB

Total Files

10

Last publish

Collaborators

  • evelynlab