Closed nex3 closed 2 weeks ago
I think you can do this with:
const { minify } = require('html-minifier-terser');
const result = await minify(`<span>foo</span>
<span>bar</span>`, {
collapseWhitespace: true, // removes whitespace
conservativeCollapse: true, // collapse to 1 space (never remove it entirely)
});
Ah, you're right!
The documentation indicates that this is a desirable feature:
But I don't see a tracking issue for it yet.