JSPM

@evelynlab/webpack-css-treeshaking-plugin

1.1.29
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q19166F
  • License MIT

a webpack loader to shake unused css code.

Package Exports

  • @evelynlab/webpack-css-treeshaking-plugin

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@evelynlab/webpack-css-treeshaking-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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