You might be able to try the following:
http://closurecompiler.codeplex.com/documentation ,
But I could not get it to work and as a result I wrote a batch file and connected it to the post-build process in the project properties. I was pleased with this solution because it allows me to easily (and in a more standardized way) configure the closing parameters. And any errors from it are reported to you whenever you build.
Kirk woll
source share