-
-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add documentation for purgecss-from-pug
- Loading branch information
Showing
3 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,22 @@ | ||
# `purgecss-from-pug` | ||
|
||
> TODO: description | ||
A PurgeCSS extractor for PUG files that automatically generates a list of used CSS selectors from your PUG files. This extractor can be used with PurgeCSS to eliminate unused CSS and reduce the size of your production builds. | ||
|
||
## Usage | ||
|
||
``` | ||
const purgecssFromPug = require('purgecss-from-pug'); | ||
import { PurgeCSS } from 'purgecss' | ||
import { purgeCSSFromPug } from 'purgecss-from-pug' | ||
const options = { | ||
content: [], // files to extract the selectors from | ||
css: [], // css | ||
extractors: [ | ||
{ | ||
extractor: purgeCSSFromPug, | ||
extensions: ['pug'] | ||
}, | ||
] | ||
} | ||
// TODO: DEMONSTRATE API | ||
const purgecss = await new PurgeCSS().purge(); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters