https://github.com/patrickhulce/nukecss-webpack
Eliminates unused CSS from your webpack bundle.
https://github.com/patrickhulce/nukecss-webpack
css nukecss purifycss remove uncss unused webpack
Last synced: 12 months ago
JSON representation
Eliminates unused CSS from your webpack bundle.
- Host: GitHub
- URL: https://github.com/patrickhulce/nukecss-webpack
- Owner: patrickhulce
- License: mit
- Created: 2017-02-20T18:12:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-02-12T02:32:36.000Z (about 7 years ago)
- Last Synced: 2024-10-19T00:51:34.418Z (over 1 year ago)
- Topics: css, nukecss, purifycss, remove, uncss, unused, webpack
- Language: JavaScript
- Homepage:
- Size: 179 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nukecss-webpack
[](https://www.npmjs.com/package/nukecss-webpack)
[](https://travis-ci.org/patrickhulce/nukecss-webpack)
[](https://coveralls.io/github/patrickhulce/nukecss-webpack?branch=master)
[](http://commitizen.github.io/cz-cli/)
[](https://david-dm.org/patrickhulce/nukecss-webpack)
Uses [nukecss](https://github.com/patrickhulce/nukecss) to eliminate unused css from your webpack bundle. Support for the `extract-text-webpack-plugin` and for `style-loader`.
````bash
# for webpack 4 and mini-css-extract-plugin
npm install --save-dev nukecss-webpack
# for webpack 2/3 and extract-text-webpack-plugin
npm install --save-dev nukecss-webpack@^1.4.0
```
## Usage
#### Install nukecss-webpack
`npm install --save-dev nukecss-webpack`
#### Setup Your Webpack Configuration
```js
const NukeCssPlugin = require('nukecss-webpack')
module.exports = {
entry: 'my-entry.js',
output: {
// ...
},
plugins: [
// ...
new NukeCssPlugin()
],
}
````
#### Save Bytes
**Before**
```
out.css 146 kB 0 [emitted] main
```
**After**
```
out.css 6.82 kB 0 [emitted] main
```