You must install the following dependencies:
"glob-all": "^3.1",
"purify-css": "^1.2",
"purifycss-webpack": "^0.7",
glob
and path
are needed for use in the configuration, namely, to compose an absolute path to search for files.
Module path
does not need to be installed, as it comes with node.js.
All file extensions to scan are listed:
moduleExtensions: ['php', 'vue', 'js'],
Specify the path with a mask to scan:
paths: []
Since the script only scans the above files, it may be unaware of some classes and delete. For this there is a "whitelist" - indicates which classes do not need to be deleted.
purifyOptions: {
whitelist: []
}
Displays a list of deleted classes in the console:
rejected: true
Link for documentation: https://github.com/webpack-contrib/purifycss-webpack