• Resolved luminsol

    (@luminsol)


    Hi guys,

    In one of my javascript files, I use a template literal like so:

    return ‘string text ${expression} string text’

    EDIT: I’m unable to include the “backtick” in the above code. The single quote ‘ should be replaced with a backtick, as in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

    But I’m finding that the JS minification is incorrectly removing the spaces to produce

    stringtexthellostringtext

    I assume this is a bug? Or is there way to have this minified without stripping of the spaces?

    • This topic was modified 3 years, 11 months ago by luminsol.
    • This topic was modified 3 years, 11 months ago by luminsol.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @luminsol

    Thank you for the reporting of this issue. We reproduced this on our test, not all spaces in the template literal are removed but indeed a few of them are.

    We’ll update the lib and fix this soon. Probably next week. Please keep an eye on this.

    Best regards,
    Abe

    Thread Starter luminsol

    (@luminsol)

    Thanks Abe, yes you are right, not every space was removed – I oversimplified it.

    Good to know a fix is on the way. Thank you to the LiteSpeed team.

    @luminsol

    Greetings. The lib updated into the latest dev commit. The spaces within template literals will be preserved. Please give it a try if you wish.

    Best regards,
    Abe

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘JS minification removes spaces from template literals’ is closed to new replies.