pages/postcss.config.js
Thomas A. Christensen II 212caea3c4
Switch to purging css only in production
Signed-off-by: Thomas A. Christensen II <25492070+MillironX@users.noreply.github.com>
2022-03-26 21:01:43 -05:00

13 lines
330 B
JavaScript

const purgecss = require("postcss-purgecss")({
content: ["./hugo_stats.json"],
defaultExtractor: (content) => {
let els = JSON.parse(content).htmlElements;
return els.tags.concat(els.classes, els.ids);
},
});
if (process.env.HUGO_ENVIRONMENT === 'production') {
module.exports = {
plugins: [purgecss],
};
}