What is the the best JavaScript compressor available? I’m looking for a tool that:
- is easy to use
- has a high compression rate
- Produce reliable end results (doesn’t mess up the code)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I recently released UglifyJS, a JavaScript compressor which is written in JavaScript (runs on the NodeJS Node.js platform, but it can be easily modified to run on any JavaScript engine, since it doesn’t need any
Node.jsinternals). It’s a lot faster than both YUI Compressor and Google Closure, it compresses better than YUI on all scripts I tested it on, and it’s safer than Closure (knows to deal with “eval” or “with”).Other than whitespace removal, UglifyJS also does the following:
foo["bar"]intofoo.barwhere possiblePS: Oh, it can “beautify” as well. 😉