Skip to content

Commit d0c6f79

Browse files
committed
fix html-minifier options to configurable.
1 parent 3293258 commit d0c6f79

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ module.exports = function(content) {
4848
content = content.join("");
4949
if(this.minimize) {
5050
content = htmlMinifier.minify(content, {
51-
removeComments: true,
52-
collapseWhitespace: true,
53-
collapseBooleanAttributes: true,
54-
removeAttributeQuotes: true,
55-
removeRedundantAttributes: true,
56-
useShortDoctype: true,
57-
removeEmptyAttributes: true,
58-
removeOptionalTags: true
59-
})
51+
removeComments: query.removeComments !== false,
52+
collapseWhitespace: query.collapseWhitespace !== false,
53+
collapseBooleanAttributes: query.collapseBooleanAttributes !== false,
54+
removeAttributeQuotes: query.removeAttributeQuotes !== false,
55+
removeRedundantAttributes: query.removeRedundantAttributes !== false,
56+
useShortDoctype: query.useShortDoctype !== false,
57+
removeEmptyAttributes: query.removeEmptyAttributes !== false,
58+
removeOptionalTags: query.removeOptionalTags !== false
59+
});
6060
}
6161
return "module.exports = " + JSON.stringify(content).replace(/xxxHTMLLINKxxx[0-9\.]+xxx/g, function(match) {
6262
if(!data[match]) return match;

0 commit comments

Comments
 (0)