Skip to content

Commit

Permalink
Add layouts to PurgeCSS content
Browse files Browse the repository at this point in the history
  • Loading branch information
regisphilibert authored and bep committed Jan 30, 2021
1 parent fe51a26 commit a81afe9
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@ module.exports = {
important: true, // See https://tailwindcss.com/docs/configuration#important
purge: {
enabled: process.env.HUGO_ENVIRONMENT === 'production',
content: [ './hugo_stats.json' ],
content: [
'./hugo_stats.json',
'./layouts/**/*.html',
],
extractors: [
{
extractor: (content) => {
let els = JSON.parse(content).htmlElements;
return els.tags.concat(els.classes, els.ids);
},
extensions: ['json']
},
],
mode: 'all',
options: {
//whitelist: [ 'pl-1', 'pl-3' ],
defaultExtractor: (content) => {
let els = JSON.parse(content).htmlElements;
els = els.tags.concat(els.classes, els.ids);
return els;
}
}

},
plugins: [ typography ]
};

0 comments on commit a81afe9

Please sign in to comment.