0

This answer made me understand UglifyJS2 allows us to Uglify multiple .js files at the same time (in order not to break the code when using the same global variables).

The code I want to uglify is very messy: I have some some inline scripts (such as onclick=), some scripts inside <script> tags and a few separate .js files.

I'm confused on how I should proceed to Uglify/obfuscate/minify/gzip them with UglifyJS without breaking any code.

Emilio
  • 1,314
  • 2
  • 15
  • 39
  • 1
    Using Uglify or Google Closure you really need to have quite clean base code specially end every line of code with ; So, if you really want to through the process of "compiling" your js code you should go through it and making it better. – Carlos Alves Jorge Aug 25 '17 at 19:28
  • @CarlosAlvesJorge I think I don't have this type of semi-colon issues. Any clues on how to deal with inline scripts? – Emilio Aug 25 '17 at 19:35
  • Best way would be to try to compile it and check if any error happens. If it does then you should remove all inline stuff and just put it all in the js. – Carlos Alves Jorge Aug 25 '17 at 19:38
  • @CarlosAlvesJorge maybe you're right! – Emilio Aug 25 '17 at 19:40

0 Answers0