Skip to content

principalstudio/principal-purgecss-extractor

Repository files navigation

Principal Purgecss extractor

Improve version of purgecss-from-pug with fix and support for BEM mixins.

Currently, only support pug files

Installation

npm i -D @principalstudio/principal-purgecss-extractor

Usage

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'],
        },
      ],
    }),
  ]
}