We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug report or Feature request? Bug report
Version (complete output of terser -V or specific git commit) terser 5.6.0
terser -V
Complete CLI command or minify() options used
minify()
{ compress: {}, mangle: {}, output: {}, parse: {}, rename: {}, }
terser input
terser
result=template(); function template() { return html` <div class="parent"> <div class="child">${set}</div> </div>`; }
terser output
Tagged templates are not compressed:
result=html` <div class="parent"> <div class="child">${set}</div> </div>`;
Expected result
result=html`\n\t<div class="parent">\n\t\t<div class="child">${set}</div>\n\t</div>`;
The text was updated successfully, but these errors were encountered:
There's no reasonable way for Terser to know that whitespace can be collapsed in this particular string.
Sorry, something went wrong.
If you remove the html tag, then the terser changes the string. Why doesn't anything change with the html tag?
terser input (without tag literals)
result=template(); function template() { return ` <div class="parent"> <div class="child">${set}</div> </div>`; }
terser output (result OK)
result=`\n\t<div class="parent">\n\t\t<div class="child">${set}</div>\n\t</div>`;
Terser can't inline html because it's a function call you're importing from an external module. It has unknown side effects.
html
No branches or pull requests
Bug report or Feature request?
Bug report
Version (complete output of
terser -V
or specific git commit)terser 5.6.0
Complete CLI command or
minify()
options usedterser
inputterser
outputTagged templates are not compressed:
Expected result
The text was updated successfully, but these errors were encountered: