SiteWebAstrolabe/src/transforms/html-min-transform.js
2020-06-19 23:47:44 +02:00

15 lines
355 B
JavaScript

const htmlmin = require('html-minifier');
module.exports = function htmlMinTransform(value, outputPath) {
if (outputPath.indexOf('.html') > -1) {
let minified = htmlmin.minify(value, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true,
minifyCSS: true
});
return minified;
}
return value;
};