Usually, minifying JavaScript code isn't all that effective. The JSMin minifyer that is used in the baking script just removes whitespace. Google's closure compiler also shortens variable names etc. That might give you another 10-30% smaller filesize.

The main purpose of the baking script is not to shrink the filesize, but to combine all source files into one big file. This already cuts the loading time immensely, because every single HTTP request has some overhead, so limiting the number of requests is often more important than the size of the files.

If you still want to shrink the filesize, configure your webserver to send your .js files gzipped.

Here's an example: the Biolab Disaster source was 248kb before baking and 219kb afterwards. Google's closure compiler is able to shrink it further to 186kb (I didn't bother with that). However if you look at the size of the source (Right-Click -> View Page Info in Firefox), you will see that is only 46kb because it has been sent gzipped.

A basic .htaccess file for Apache that will enable gzip compression on .js, .css and .html files (provided that mod_deflate is available) looks like this:

I'd like to run my game.min.js through the Google Closure Compiler. However, when I tried this, I get JSC_TRAILING_COMMA error due to a trailing comma in an array in lib/impact/system.js

The error message states: "If you are targeting newer versions of JS, set the appropriate language_in option."

I searched for documentation on 'language_in', but so far I have been unsuccessful. Does anyone know the correct 'language_in' setting to target the newer versions of JS (which I believe will work with any browser that supports canvas).

I use impact-node with Impact games instead of Dominic's default setup. It allows you to use Weltmeister without *AMP / PHP and the bake command makes smaller files than Dominic's script. The author responded to some of the issues I brought up and it's pretty cool if you are into Node.js.