I've been reading this post about minifying and compressing static files like CSS/JS within the publish/package event in VS2010.
I wonder if it also is possible to combine the files to one CSS file and one JS file? And how that can be done in this process.
As far as minifying and compressing your CSS and JS files - that shouldn't be any issue.
However - when it comes to actually combining all of your related files (CSS & JS) into single files, you will need to be careful to avoid any naming conflicts that can occur.
(This is especially important if you are using some already minified JS files - as variables like
a,b,c
etc. will be used often.)The YUI Compresser can handle both the compression of CSS and JavaScript files.
Hope this helps.
Publish time merging is good idea but sometimes say page "A" needs 'a.js' and 'b.js' whereas page "B" needs 'a.js' and 'c.js' and there can many such dynamic combinations. Doing this check at build time and then grouping is sometimes very hectic.
What if grouping happens on the fly for required resources and with one HTTP request like this...
WebUtilities library (for J2EE) does exactly same and helps with many other front end optimizations.
Here is the link. Have look in case you find it useful.