terser / html-minifier-terser

actively maintained fork of html-minifier - minify HTML, CSS and JS code using terser - supports ES6 code
https://terser.org/html-minifier-terser
MIT License
376 stars 30 forks source link

[Bug]: Scripts minfiier has cloned variable names that crashes program when mange is activated #173

Open Mrgaton opened 10 months ago

Mrgaton commented 10 months ago

What happened?

i have two diferent scripts that defines diferent const and two of them defines them witht he same variable name and enter in conflict

Version

latest

What browsers are you seeing the problem on?

Firefox, Chrome, Safari

Link to reproduce

https://genocidioastral.fundacionamigos.repl.co/Pages/doxeo.html

Relevant log output

Warning to the link is a meme page that gravs your ip and makes it dance like you got hacked i know very bruh but xd

Willing to submit a PR?

None

Mrgaton commented 10 months ago

it only happends when you have

minifyJS: { toplevel: true},

Mrgaton commented 10 months ago

teaser would have to have the context of all the scripts at the same time so that even with the top level activated it does not define variables with the same name over and over again

Mrgaton commented 10 months ago

image image