pkrumins/node-jsmin

Failing to preserve whitespace in template literals

Opened this issue · 0 comments

Here is a minimal example using jsmin 1.0.1 from npm:

const token = "String";
const message = `Unexpected ${token} encountered`;

The result of running JSMin:

const token="String";const message=`Unexpected ${token}encountered`;

Observe how the space after the closing curly brace in the template literal has been removed, which changes the value of message.

Environment: MS Windows 11 home, Node Js 18.12.1

I ran the code through JSLint.com without a fault.