2022-03-21 20:05:10 -04:00
|
|
|
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);
|
|
|
|
},
|
2022-02-02 01:43:30 -05:00
|
|
|
});
|
|
|
|
|
2023-02-25 00:13:45 -05:00
|
|
|
if (process.env.HUGO_ENVIRONMENT === "production") {
|
2022-03-26 22:01:43 -04:00
|
|
|
module.exports = {
|
|
|
|
plugins: [purgecss],
|
|
|
|
};
|
|
|
|
}
|