JavaScript API
Start by installing PurgeCSS as a dev dependency.
You can now use PurgeCSS inside a JavaScript file.
In the following examples, the options passed to PurgeCSS are the same as the ones here. The result purgecssResult
is an array of an object containing the name of the files with the purged CSS.
ES6 with import
The format of purgecssResult is
ES5 with require
Last updated