tedious/JShrink

proper string concatenation

columbian-chris opened this issue · 1 comments

JShrink takes this:

var hello = 'hi ' + 'there';

and turns it into:

var hello='hi '+'there';

It is unnecessary in javascript minification to join strings with concatenation operators (plus signs). Proper minification would produce:

var hello='hi there';

JShrink is designed to be a quick inline minifier that sacrificed perfect minification in favor of performance. It only removes whitepsace, it does not make any attempts to rewrite code- doing so would be much more complex, and honestly there's better tools out there for that (which can be run to create static bundles, where the performance isn't as much of a concern).