Gatsby plugin for purgecss. Removes unused css/sass/less/stylus. Supports tailwind, bootstrap, bulma etc.
rejected
option. Instead use printSummary: false
if you don't want the stats to show.// gatsby-config.js BEFORE
{
resolve: `gatsby-plugin-purgecss`,
options: {
rejected: true,
printRejected:true,
ignore: ['/ignore.css'],
whitelist: ['mySelector']
},
},
// gatsby-config.js AFTER
{
resolve: `gatsby-plugin-purgecss`,
options: {
printRejected:true,
ignore: ['/ignore.css'],
purgeCSSOptions: {
safelist: ['mySelector']
},
},
},
extractors: [
{
extractor: (content) => {
// return array of css selectors
},
extensions: ['js']
}
]