Skip to content

Commit e94a9c4

Browse files
committed
Disable collapseWhitespace.
Comment elaborates on context, but the HTML whitespace post intentionally depends on not collapsing whitespacing and there's no easy way to opt-it out. I quick check of the page indicates the benefit is minimal anyways, so I'm inclined ot just turn it off. If anything this just reinforces the point of that post that HTML is broken, given that my attempt at minification broke a blog post.
1 parent d747e0d commit e94a9c4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

configs/html_minifier.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ const HtmlMinifier = require('html-minifier-terser');
66
module.exports.htmlMinifierConfig = {
77
caseSensitive: true,
88
collapseBooleanAttributes: true,
9-
collapseWhitespace: true,
9+
10+
// HTML Whitespace post, Example 31 depends on whitespace collapsing not
11+
// happening. Also the size benefit of this seems minimal anyways (~126KB vs
12+
// ~128KB) for that page. Therefore I have decided I don't care.
13+
collapseWhitespace: false,
14+
1015
decodeEntities: true,
1116
removeAttributeQuotes: true,
1217
removeComments: true,

0 commit comments

Comments
 (0)