Webpack doubles text on minimization

44 Views Asked by At

I use Webpack to minimize JavaScript; This code

let a = "a";
let b = "b";
let c = "c";
let r =  a + `${b}` + ("[IT_DOUBLES]" + c + "d");
console.log('r = ' + r);

results to minimized

let i="a",o="b",a="c",s=i+`${o}[IT_DOUBLES][IT_DOUBLES]`+a+"d";console.log("r = "+s);

And the wrong result is shown in the console:

r = ab[IT_DOUBLES][IT_DOUBLES]cd

Is there any problems in minimization or any guides for writing correct JS, that can be minimized?

npm 8.19.2

webpack 5.74.0

0

There are 0 best solutions below