Skip to content
This repository was archived by the owner on Feb 1, 2020. It is now read-only.

Commit 2846dca

Browse files
committed
adding documentation and example for 'only' param
1 parent 30009a9 commit 2846dca

15 files changed

+24606
-23
lines changed

README.md

+33-23
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,45 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin')
2727
const PurgecssPlugin = require('purgecss-webpack-plugin')
2828

2929
const PATHS = {
30-
src: path.join(__dirname, 'src')
30+
src: path.join(__dirname, 'src')
3131
}
3232

3333
module.exports = {
34-
entry: './src/index.js',
35-
output: {
36-
filename: 'bundle.js',
37-
path: path.join(__dirname, 'dist')
38-
},
39-
module: {
40-
rules: [
41-
{
42-
test: /\.css$/,
43-
use: ExtractTextPlugin.extract({
44-
fallback: 'style-loader',
45-
use: 'css-loader?sourceMap'
34+
entry: './src/index.js',
35+
output: {
36+
filename: 'bundle.js',
37+
path: path.join(__dirname, 'dist')
38+
},
39+
module: {
40+
rules: [
41+
{
42+
test: /\.css$/,
43+
use: ExtractTextPlugin.extract({
44+
fallback: 'style-loader',
45+
use: 'css-loader?sourceMap'
46+
})
47+
}
48+
]
49+
},
50+
plugins: [
51+
new ExtractTextPlugin('[name].css?[hash]'),
52+
new PurgecssPlugin({
53+
paths: glob.sync(`${PATHS.src}/*`)
4654
})
47-
}
4855
]
49-
},
50-
plugins: [
51-
new ExtractTextPlugin('[name].css?[hash]'),
52-
new PurgecssPlugin({
53-
paths: glob.sync(`${PATHS.src}/*`)
54-
})
55-
]
5656
}
5757
```
5858

59+
you can also limit plugin to certain entrypoints via `only` param:
60+
61+
```
62+
new PurgecssPlugin({
63+
paths: glob.sync(`${PATHS.src}/*`),
64+
styleExtensions: ['.css'],
65+
only: ['bundle', 'vendor']
66+
})
67+
```
68+
5969
## Contributing
6070

6171
Please read [CONTRIBUTING.md](./.github/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
@@ -66,8 +76,8 @@ We use [SemVer](http://semver.org/) for versioning.
6676

6777
## Acknowledgment
6878

69-
Purgecss was originally thought as the v2 of purifycss. And because of it, it is greatly inspired by it.
70-
The plugins such as purgecss-webpack-plugin are based on the purifycss plugin.
79+
Purgecss was originally thought as the v2 of purifycss. And because of it, it is greatly inspired by it.
80+
The plugins such as purgecss-webpack-plugin are based on the purifycss plugin.
7181
Below is the list of the purifycss repositories:
7282

7383
* [purifycss](https://github.com/purifycss/purifycss)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.hello {
2+
color: red;
3+
}
4+
5+
.whitelisted {
6+
color: green;
7+
}
8+
9+
md\:w-2\/3 {
10+
color: red;
11+
}

0 commit comments

Comments
 (0)