views:

287

answers:

4

I need to pack all my js, but need to edit it going into source control.

is there a nice easy plugin for ccnet, or nant, that will allow me to pack my js, and store them in the same files on the way out to production.

Not really looking for file combining, just minifying each file.

A: 

I built my own Nant task off of this one.

http://www.nabble.com/Re:-All-.js-files-into-1-p19593677.html

George
I'm looking for something that is more impervious to my references to the js, since we're still in active js development, combining files becomes troublesome in development unless you ref files differently in dev and prod which is kinda tweaky
DevelopingChris
+1  A: 

Here is the best answer I have found. It calls the YUI version of minify and just uses plain old Nant to do so and replace the existing js files with the minifyed ones.

http://codeclimber.net.nz/archive/2007/08/22/How-to-use-YUI-JS-Compressor-inside-a-NAnt-build.aspx

DevelopingChris
A: 

I use copy concatenation and the YUI Compressor in a post build script. Old-school batch file style.

The compressor works like a charm. My .NET website application uses the website deployment project and is continuously built by TeamCity. A bit hackish perhaps, but it works.

Aaron Wagner
A: 

I have written my own custom tool for this, its part of the runtime but could be easily changed to work in the continous integration process. It uses google's closure compiler. Check it out:

http://www.picnet.com.au/blogs/Guido/post/2009/12/10/Javascript-runtime-compilation-using-AspNet-and-Googles-Closure-Compiler.aspx

Thanks

Guido

gatapia