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

Commit e934b93

Browse files
committed
update README
- add information about option paths
1 parent 130cd8e commit e934b93

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,23 @@ module.exports = {
6060

6161
The options available in purgecss [Configuration](https://www.purgecss.com/configuration.html) are also avaiable in the webpack plugin with the exception of css and content.
6262

63+
* #### paths
64+
65+
With the webpack plugin, you can specified the content that should be analyized by purgecss with an array of filename. It can be html, pug, blade, ... files. You can use a module like `glob` or `glob-all` to easily get a list of files.
66+
67+
```js
68+
const PurgecssPlugin = require('purgecss-webpack-plugin')
69+
const glob = require('glob')
70+
const PATHS = {
71+
src: path.join(__dirname, 'src')
72+
}
73+
74+
// In the webpack configuration
75+
new PurgecssPlugin({
76+
paths: glob.sync(`${PATHS.src}/*`)
77+
})
78+
```
79+
6380
* #### only
6481

6582
You can specify entrypoints to the purgecss-webpack-plugin with the option only:

0 commit comments

Comments
 (0)