mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-20 16:38:37 +01:00
16 lines
444 B
JavaScript
16 lines
444 B
JavaScript
|
|
// Remove unused CSS selectors.
|
||
|
|
const purgecss = require('@fullhuman/postcss-purgecss')({
|
||
|
|
// Use stats generated by Hugo.
|
||
|
|
content: [ './hugo_stats.json' ],
|
||
|
|
defaultExtractor: (content) => {
|
||
|
|
let els = JSON.parse(content).htmlElements;
|
||
|
|
return els.tags.concat(els.classes, els.ids);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
module.exports = {
|
||
|
|
plugins: [
|
||
|
|
...(process.env.HUGO_ENVIRONMENT === 'production' ? [ purgecss ] : [])
|
||
|
|
]
|
||
|
|
};
|