@@ -27,35 +27,45 @@ const ExtractTextPlugin = require('extract-text-webpack-plugin')
27
27
const PurgecssPlugin = require (' purgecss-webpack-plugin' )
28
28
29
29
const PATHS = {
30
- src: path .join (__dirname , ' src' )
30
+ src: path .join (__dirname , ' src' )
31
31
}
32
32
33
33
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 } /*` )
46
54
})
47
- }
48
55
]
49
- },
50
- plugins: [
51
- new ExtractTextPlugin (' [name].css?[hash]' ),
52
- new PurgecssPlugin ({
53
- paths: glob .sync (` ${ PATHS .src } /*` )
54
- })
55
- ]
56
56
}
57
57
```
58
58
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
+
59
69
## Contributing
60
70
61
71
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.
66
76
67
77
## Acknowledgment
68
78
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.
71
81
Below is the list of the purifycss repositories:
72
82
73
83
* [ purifycss] ( https://github.com/purifycss/purifycss )
0 commit comments