Question

We have several Java projects that have extensive JavaScript and we currently use an old version of YUICompressor (2.4.2). However, I found in this blogpost that YUICompressor is being deprecated.

Because of this, we would like to find a replacement JavaScript compressor. However, there are a few issues. First of all, it would be nice if this was something was written in Java. I've been looking at UglifyJS and apparently the Yahoo team is moving towards a wrapper around UglifyJS called Yuglify.

It looks like UglifyJS is now the most popular tool as of now. Unfortunately, UglifyJS is written in JavaScript which makes it hard for us to execute as part of our build system. We would need to install NodeJS on all of our build servers, and I would have to support it in our al of our developers' machines (including in their various IDEs). This would include four different development shops scattered around the U.S., and our overseas developers. I'm afraid of developers not installing and not testing JavaScript compression because they don't know how to install NodeJS in order to use UglifyJS on their systems.

A Java based JavaScript compressor would work best for us (and one that can handle CSS too would be a bonus). This will allow us to use it on our current environment without any changes.

Was it helpful?

Solution

The Closure Compiler by google is written in java, and if you are willing to write your code in a rather complex way, it is capable of the best minification out there. https://developers.google.com/closure/compiler/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top