16 lines
496 B
JavaScript
16 lines
496 B
JavaScript
|
const purgecss = require('@fullhuman/postcss-purgecss')({
|
||
|
content: [ './hugo_stats.json' ],
|
||
|
defaultExtractor: (content) => {
|
||
|
let els = JSON.parse(content).htmlElements;
|
||
|
return els.tags.concat(els.classes, els.ids);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
module.exports = {
|
||
|
plugins: [
|
||
|
require('autoprefixer'),
|
||
|
...process.env.HUGO_ENVIRONMENT === 'production' ? [purgecss] : [],
|
||
|
require('cssnano')({preset: ['advanced', {"discardComments": {"removeAll": true}}]}),
|
||
|
]
|
||
|
};
|