purgecss
Advanced tools
Comparing version 0.3.0 to 0.3.1
{ | ||
"name": "purgecss", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Remove unused css selectors.", | ||
@@ -68,2 +68,2 @@ "main": "./lib/purgecss.js", | ||
} | ||
} | ||
} |
@@ -97,4 +97,40 @@ # Purgecss | ||
> In progress | ||
```js | ||
const path = require('path') | ||
const glob = require('glob') | ||
const ExtractTextPlugin = require('extract-text-webpack-plugin') | ||
const PurgecssPlugin = require('../../') | ||
const PATHS = { | ||
src: path.join(__dirname, 'src') | ||
} | ||
module.exports = { | ||
entry: './src/index.js', | ||
output: { | ||
filename: 'bundle.js', | ||
path: path.join(__dirname, 'dist') | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/, | ||
use: ExtractTextPlugin.extract({ | ||
fallback: 'style-loader', | ||
use: 'css-loader?sourceMap' | ||
}) | ||
} | ||
] | ||
}, | ||
plugins: [ | ||
new ExtractTextPlugin('[name].css?[hash]'), | ||
new PurgecssPlugin({ | ||
paths: glob.sync(`${PATHS.src}/*`), | ||
styleExtensions: ['.css'] | ||
}) | ||
] | ||
} | ||
``` | ||
##### Rollup | ||
@@ -172,2 +208,11 @@ | ||
## Acknowledgment | ||
Purgecss was originally thought as the v2 of purifycss. And because of it, it is greatly inspired by it. | ||
The plugins such as purgecss-webpack-plugin are based on the purifycss plugin. | ||
Below is the list of the purifycss repositories: | ||
- [purifycss](https://github.com/purifycss/purifycss) | ||
- [gulp-purifycss](https://github.com/purifycss/gulp-purifycss) | ||
- [purifycss-webpack](https://github.com/webpack-contrib/purifycss-webpack) | ||
## License | ||
@@ -174,0 +219,0 @@ |
671069
235