Search code examples
minifyuglifyjsuglifyjs2

Tell UglifyJS to skip a particular area of code


Is there a way to tell UglifyJS to skip a particular section of code, perhaps using comments like this:

// uglifyjs:skipStart
filter = function(item){ /* some crazy filter logic that will repeat 500,000 times */ }
// uglifyjs:skipEnd

My use case has to do with avoiding the minification of a function that will be inlined and parsed in a custom way for performance gain. Minification breaks the simplified parser.


Solution

  • Unfortunately, there is not a way to do this.