Package Exports
- @wenprise/purgecss-with-wordpress
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@wenprise/purgecss-with-wordpress) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Purgecss with Wordpress
Based on the gist made by @frnwtr, purgecss-with-wordpress is a set of templates for
Wordpress CMS.
Getting Started
Installation
You need to install purgecss first.
Install wenprise-purgecss-whitelist:
npm i --save-dev wenprise-purgecss-whitelistUsage
import Purgecss from 'purgecss'
import purgecssWhiteList from 'wenprise-purgecss-whitelist'
const purgeCss = new Purgecss({
content: ['**/*.html'],
css: ['**/*.css'],
whitelist: purgecssWhiteList.whitelist.concat([
'ln-letters',
'letterCountShow',
]),
whitelistPatterns: purgecssWhiteList.whitelistPatterns.concat([
/ln-*/,
/listNav*/,
])
})
const result = purgecss.purge()If you have additional classes you want to include in either of the whitelist or whitelistPatterns, you can include them using the spread operator:
whitelist: [
...purgecssWhiteList.whitelist,
'red',
'blue',
],
whitelistPatterns: [
...purgecssWhiteList.whitelistPatterns,
/^red/,
/blue$/,
]Versioning
Purgecss-with-wordpress use SemVer for versioning.
Acknowledgment
Purgecss-with-wordpress is based on the gist made by @frnwtr
License
This project is licensed under the MIT License - see the LICENSE file for details.