Best packing strategy for js during continuous integration?

自闭症网瘾萝莉.ら 提交于 2020-01-24 09:47:25

问题


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.


回答1:


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




回答2:


I built my own Nant task off of this one.

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




回答3:


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.




回答4:


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



来源:https://stackoverflow.com/questions/258781/best-packing-strategy-for-js-during-continuous-integration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!