How to use html-minifier

Comprehensive html-minifier code examples:

How to use html-minifier.minify:

98
99
100
101
102
103
104
105
106
107
});

// Minify HTML output
eleventyConfig.addTransform("htmlmin", function(content, outputPath) {
    if (outputPath && outputPath.indexOf(".html") > -1) {
        let minified = htmlmin.minify(content, {
            useShortDoctype: true,
            removeComments: true,
            collapseWhitespace: true
        });