I often use empty functions as HereDoc blocks when templating.
var heredoc = function() {/*
<div>
Hello World!
</div>
*/};
The UglifyJS2 compressor removes all comments, which is generally desirable. Except for this one! I thought to use "--comments" on the command-line and "/** @preserve" in the comment block, which did not work. I also tried regular expressions. Here is a specific command I tried on the above JS file:
uglifyjs test.js -o test.min.js -p 5 -c -m --comments /div/i
And the result was as follows:
var heredoc=function(){};
I'm finding it difficult to get any regular expression to work at all...
/* div keep me */
var heredoc = function() {/** @preserve
<div>
Hello World!
</div>
*/};
heredoc();
placement of the comment inside or outside; calling the function directly or not. Nothing is working.
uglify-js 2.6.1