diff --git a/index.js b/index.js index e6779f5f..764e0fc6 100644 --- a/index.js +++ b/index.js @@ -115,10 +115,11 @@ class HtmlWebpackPlugin { const minify = this.options.minify; if (minify === true || (minify === 'auto' && isProductionLikeMode)) { - /** @type { import('html-minifier').Options } */ + /** @type { import('html-minifier-terser').Options } */ this.options.minify = { - // https://github.com/kangax/html-minifier#options-quick-reference + // https://www.npmjs.com/package/html-minifier-terser#options-quick-reference collapseWhitespace: true, + keepClosingSlash: true, removeComments: true, removeRedundantAttributes: true, removeScriptTypeAttributes: true, diff --git a/spec/basic.spec.js b/spec/basic.spec.js index 5d706c47..5e95725a 100644 --- a/spec/basic.spec.js +++ b/spec/basic.spec.js @@ -2304,4 +2304,27 @@ describe('HtmlWebpackPlugin', () => { ] }, [/