notes/sources/utilities/transforms/htmlminify.js

13 lines
304 B
JavaScript
Raw Normal View History

2022-11-04 23:25:35 -06:00
const htmlmin = require('html-minifier')
module.exports = (content, outputPath = '.html') => {
if ( !String(outputPath).endsWith('.html') ) return content;
return htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true
})
}