Open rochapablo opened 3 years ago
It should be, is this a question or a bug report? If the latter what's the issue?
It's not working, the entire file it's minified expect that code.
Can you provide your expected and actual outputs?
What I expect (no extra space or lines break)
return`<div class=""><div class="audio"><div class="ad hidden"><div><div><span class="ad-label">aaa</span><span class="ad-countdown"</span></div><a class="ad-link" target="_blank" rel="noopener">aaa</a></div></div>`;
What I'm getting (extra space and lines break)
return`
<div class="">
<div class="audio">
<div class="ad hidden"><div><div><span class="ad-label">aaa</span><span class="ad-countdown"></span></div><a class="ad-link" target="_blank" rel="noopener">aaa</a></div></div>
`;
Right sorry, now I understand.
Erm, well, this doesn't currently "work" - because its a template literal, the clues in the name, its literally whatevers between the backticks.
I do understand your usecase, however theres no real practical way for NUglify to know that a particular template should be treated as HTML and minified and not another, without adding some minification annotation to the javascript itself.
You might be better off having the template in a separate file and @importing it.
I'll leave this open as a curiosity, suggestions and PRs welcome
Is it possible to minify javascript strings like the following example: