0

I have a need for compressing JavaScript in a PHP environment. System calls are okay, but I'm working in PHP.

I don't want to have to download and install NodeJS just to get access to Uglify, but Uglify seems to be the only reliable* minifier.

Can anyone point me to how this can be done, or if not are there any other good minifiers/manglers?

* Closure Compiler somehow manages to return bigger files due to being overzealous with putting string contants into the places they are used

Niet the Dark Absol
  • 301,028
  • 70
  • 427
  • 540
  • Regarding your Closure Compiler note, does it actually result in a larger gzipped result? In my experience, those sorts of variable substitutes for constants don't pay off at all when gzipping. –  May 11 '13 at 02:50
  • Yes, in this particular case it resulted in a 3% bigger gzipped file compared to the original gzipped size. – Niet the Dark Absol May 11 '13 at 02:50
  • Have you tried YUI compressor? It runs on the JVM as well. –  May 11 '13 at 02:54
  • Well, sort of. I can't seem to find a download of the right thing. I've tried all the download links but none of them actually contain the compressor... – Niet the Dark Absol May 11 '13 at 03:17
  • Yeah, I wouldn't be much help there. I've only used some of the online versions, [like this](http://refresh-sf.com/yui/). For the most part I've either used Closure Compiler or Uglify. –  May 11 '13 at 03:21
  • use curl to emulate a post to http://marijnhaverbeke.nl/uglifyjs – Orangepill May 11 '13 at 05:16
  • Duplicate of http://stackoverflow.com/questions/14764529/how-to-run-uglifyjs2-without-node-js – Ortomala Lokni Jun 24 '14 at 08:16

0 Answers0