So I have an ASP.NET MVC app that references a number of javascript files in various places (in the site master and additional references in several views as well).
I have written something to handle this for me automatically. It uses google's closure compiler. You can read the code here:
http://www.picnet.com.au/blogs/Guido/post/2009/12/10/Javascript-runtime-compilation-using-AspNet-and-Googles-Closure-Compiler.aspx
Thanks
Guido