html minify on production

This commit is contained in:
Matt DeCamp 2021-09-02 22:06:00 -04:00
parent 676c9540a4
commit 6b9fb002c0

13
src/transforms/html-min.js vendored Normal file
View file

@ -0,0 +1,13 @@
const htmlmin = require('html-minifier');
module.exports = (value, outputPath) => {
if (outputPath && outputPath.indexOf('.html') > -1) {
return htmlmin.minify(value, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true,
minifyCSS: true
});
}
return value;
}