views:

61

answers:

3

Is there a way to make the web deployment project automatically compress js and css files when building it? how can I automate this process?

A: 

If you are using a build server (Team Build or something else) you can probably find, or certainly build, a custom task to handle this.

Peter LaComb Jr.
+1  A: 

Pithy is what we use.

http://github.com/clearwavebuild/Pithy/tree/2009.12.22.1000

Has nice preprocessor support, too. (dotlesscss)

BnWasteland
Actually, I misread... this solution does is on the fly, not at build time.
BnWasteland
A: 

You can accomplish that by adding an MSBuild task to your web deployment project that would compress your JS and CSS for you. Here is an example using the YUI compressor.

You could also do something similar with other compression libraries by using the Exec MSBuild task to execute a command line compression tool.

Greg Shackles