purgecss-with-wordpress
Advanced tools
Comparing version
61
index.js
module.exports = { | ||
whitelist: [ | ||
"rtl", | ||
"home", | ||
"blog", | ||
"archive", | ||
"date", | ||
"error404", | ||
"logged-in", | ||
"admin-bar", | ||
"no-customize-support", | ||
"custom-background", | ||
"wp-custom-logo" | ||
'rtl', | ||
'home', | ||
'blog', | ||
'archive', | ||
'date', | ||
'error404', | ||
'logged-in', | ||
'admin-bar', | ||
'no-customize-support', | ||
'custom-background', | ||
'wp-custom-logo', | ||
'alignnone', | ||
'alignright', | ||
'alignleft', | ||
'wp-caption', | ||
'wp-caption-text', | ||
'screen-reader-text', | ||
'comment-list', | ||
], | ||
whitelistPatterns: [ | ||
/^search(-.*)?$/, | ||
/^(.*)-template(-.*)?$/, | ||
/^(.*)?-?single(-.*)?$/, | ||
/^postid-(.*)?$/, | ||
/^attachmentid-(.*)?$/, | ||
/^attachment(-.*)?$/, | ||
/^page(-.*)?$/, | ||
/^(post-type-)?archive(-.*)?$/, | ||
/^author(-.*)?$/, | ||
/^category(-.*)?$/, | ||
/^tag(-.*)?$/, | ||
/^tax-(.*)?$/, | ||
/^term-(.*)?$/, | ||
/^(.*)?-?paged(-.*)?$/ | ||
] | ||
} | ||
/^search(-.*)?$/, | ||
/^(.*)-template(-.*)?$/, | ||
/^(.*)?-?single(-.*)?$/, | ||
/^postid-(.*)?$/, | ||
/^attachmentid-(.*)?$/, | ||
/^attachment(-.*)?$/, | ||
/^page(-.*)?$/, | ||
/^(post-type-)?archive(-.*)?$/, | ||
/^author(-.*)?$/, | ||
/^category(-.*)?$/, | ||
/^tag(-.*)?$/, | ||
/^tax-(.*)?$/, | ||
/^term-(.*)?$/, | ||
/^(.*)?-?paged(-.*)?$/, | ||
], | ||
}; |
{ | ||
"name": "purgecss-with-wordpress", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "purgecss with wordpress", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,3 +23,3 @@ # Purgecss with Wordpress | ||
import Purgecss from 'purgecss' | ||
import purgecssWordpress from 'purgecss-with-worpress' | ||
import purgecssWordpress from 'purgecss-with-wordpress' | ||
@@ -29,3 +29,3 @@ const purgeCss = new Purgecss({ | ||
css: ['**/*.css'], | ||
whitelist: purgecssWorpress.whitelist, | ||
whitelist: purgecssWordpress.whitelist, | ||
whitelistPatterns: purgecssWordpress.whitelistPatterns | ||
@@ -36,2 +36,17 @@ }) | ||
If you have additional classes you want to include in either of the `whitelist` or `whitelistPatterns`, you can include them using the spread operator: | ||
```js | ||
whitelist: [ | ||
...purgecssWordpress.whitelist, | ||
'red', | ||
'blue', | ||
], | ||
whitelistPatterns: [ | ||
...purgecssWordpress.whitelistPatterns, | ||
/^red/, | ||
/blue$/, | ||
] | ||
``` | ||
## Versioning | ||
@@ -48,2 +63,2 @@ | ||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file | ||
for details. | ||
for details. |
3820
12.95%38
26.67%61
35.56%