2

Is it safe to take a library who compile their distribution scripts with say, Closure Compiler, and compile it with Uglify JS?

Any documented risks?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
  • 1
    I'm just excited to learn there's something called *Uglify JS* – Mike Christensen Jun 21 '13 at 20:27
  • See [this question](http://stackoverflow.com/questions/8730910/is-it-bad-practise-to-use-squishit-to-minify-javascript-which-is-already-minifed) for a specific example where it does work. I'm not sure why you'd want to do that though. It doesn't really add anything, and some tools, like [Minify](https://code.google.com/p/minify/), will automatically skip already-minified files. – Moshe Katz Jun 21 '13 at 20:36
  • Closure compiler has [substantial caveats](https://developers.google.com/closure/compiler/docs/api-tutorial3) that accompany advanced mode. Advanced-mode closure is therefore incompatible with virtually all minifiers, i.e., it will mess up most code that other minifiers would handle fine (the exception being code that is writen specifically for advanced-mode closure). – apsillers Jun 21 '13 at 20:37
  • @MikeChristensen It's actually the one behind jQuery and many others! – BenMorel Jun 21 '13 at 20:49
  • @MosheKatz I know I could just concat the already minified files, just curious if I could use the same uncompiled JS source I want to use in development, and compile it for production along with my own files, rather than keeping every `.js` along with its associated `.min.js`! – BenMorel Jun 21 '13 at 20:51
  • @apsillers Does that mean that the other way is safe, i.e. taking some code designed for Closure Compiler, and compile it with UglifyJS? – BenMorel Jun 21 '13 at 20:53

0 Answers0