Improve version of purgecss-from-pug with fix and support for BEM mixins.
Currently, only support pug files
npm i -D @principalstudio/principal-purgecss-extractor
See https://purgecss.com/extractors.html
For example with PostCSS
const principalExtractor = require('principal-purgecss-extractor');
const purgecss = require('@fullhuman/postcss-purgecss')
module.exports = {
plugins: [
purgecss({
content: ['./**/*.pug'],
extractors: [
{
extractor: principalExtractor,
extensions: ['pug'],
},
],
}),
]
}