How can I turn off UglifyJS binding declarations with commas. I can not use breakpoints

UglifyJS uses commas to chain, declare objects and variables. This is great for productions, and when the file is thumbnailed, however it is very difficult to go through javascript with breakpoints when debugging js. I need to know how to disable this feature in the UglifyJS Grunt plugin.

Below is the result.

var boom = function(a) { ... }, bing = function(b){ ... }, bam = function(c) { ... }; 
+5
source share
2 answers

Ok, I figured it out. In the Grunt file in the> compress options add the parameter

sequences: false

which will stop replacing half-columns with commas. Then you can use breakpoints as usual.

 uglify: { options: { compress: { sequences: false } } } 
+4
source

This can help Gulp users using gulp -uglify:

  .pipe( uglify({ compress:{ sequences:false } }) ) 
+5
source

Source: https://habr.com/ru/post/1201294/


All Articles