Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lin-xi/webpack-css-treeshaking-plugin
webpack css treeshaking plugin
https://github.com/lin-xi/webpack-css-treeshaking-plugin
css-tree-shaking tree-shaking webpack-plugin weppack
Last synced: 3 months ago
JSON representation
webpack css treeshaking plugin
- Host: GitHub
- URL: https://github.com/lin-xi/webpack-css-treeshaking-plugin
- Owner: lin-xi
- Created: 2017-08-04T15:56:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-11T15:43:36.000Z (about 5 years ago)
- Last Synced: 2024-07-09T13:12:31.019Z (4 months ago)
- Topics: css-tree-shaking, tree-shaking, webpack-plugin, weppack
- Language: JavaScript
- Size: 675 KB
- Stars: 82
- Watchers: 5
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-star - webpack-css-treeshaking-plugin - xi | 81 | (JavaScript)
README
# webpack-css-treeshaking-plugin
[![Build Status](https://travis-ci.org/lin-xi/webpack-css-treeshaking-plugin.svg?branch=master)](https://travis-ci.org/lin-xi/webpack-css-treeshaking-plugin)
[![Coverage Status](https://coveralls.io/repos/github/lin-xi/webpack-css-treeshaking-plugin/badge.svg?branch=master)](https://coveralls.io/github/lin-xi/webpack-css-treeshaking-plugin?branch=master)
[![npm package](https://img.shields.io/npm/v/webpack-css-treeshaking-plugin.svg)](https://www.npmjs.org/package/webpack-css-treeshaking-plugin)
[![NPM downloads](http://img.shields.io/npm/dm/webpack-css-treeshaking-plugin.svg)](https://npmjs.org/package/webpack-css-treeshaking-plugin)a webpack plugin to shake unused css code
-------
## how to use
```javascript
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.
```javascript
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