YUI库是一组工具和控件,它们用JavaScript写成, 为的是用DOM 脚本,DHTML和AJAX等技术创建丰富的网页交互式应用程序。YUI 基于BSD协议,对所有的使用方式都是免费的。YUI 项目包括YUI 库和两个创建时工具:YUI Compressor (压缩)和YUI Doc(JavaScripts代码的文档引擎)
今天研究了一下YUI yahoo开源框架,感觉很猛啊。
于是乎我做了一个YUI的ant实现,网上好多关于bat的实现,我就另辟蹊径,出个关于这个的ant实现,嘿嘿独一无二的文章,如果转载的话,其注明作者和网站
copyright:Mr.chen
好了具体操作如下:
官网:
yuicompressor-2.4.6.jar 下载地址 http://yuilibrary.com/downloads/#yuicompressor
YUIAnt.jar 下载地址 http://www.ubik-ingenierie.com/miscellanous/YUIAnt/
具体的相关代码如下:
#css work dir commonCss.dir = css #js wo<mark style="color:transparent">来源gaodaimacom搞#代%码网</mark>rk dir commonJs.dir = js #build temp dir output.temp.dir = build #output files in the directory output.dir = ${output.temp.dir}_output #environment needs lib liblib = lib <!-- #######################Init the environment of the tool ##########################--> <!-- #######################Combine the css files ##########################--> <!-- #######################Combine the js files ##########################--> <!-- #######################Compress the js and css files ##########################--> <!-- first method compress the css files --> <!-- second method compress the js files--> @echo off echo ################################################ echo ##########Tool Compress the js and css########## echo ################################################ echo Please make sure your css and js in the css'directory and js'directory. echo If sure,please enter any button to continue the tool. pause call ant -buildfile compress.xml compress>build.log echo compress end pause
相关的文件我提供下载,感觉好的,就留言吧
以上就是使用YUI+Ant 实现JS CSS压缩的详细内容,更多请关注gaodaima搞代码网其它相关文章!