国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > CSS > 正文

使用YUI+Ant 實現JS CSS壓縮

2020-03-22 20:07:05
字體:
來源:轉載
供稿:網友
今天研究了一下YUI yahoo開源框架,感覺很猛啊。于是乎我做了一個YUI的ant實現,網上好多關于bat的實現,我就另辟蹊徑,出個關于這個的ant實現,嘿嘿獨一無二的文章,如果轉載的話,其注明作者和網站copyright:Mr.chen好了具體操作如下:網址:yuicompressor-2.4.6.jar 下載地址 http://yuilibrary.com/downloads/#yuicompressorYUIAnt.jar 下載地址 http://www.ubik-ingenierie.com/miscellanous/YUIAnt/具體的相關代碼如下:#css work dir commonCss.dir = css #js work 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 xml version="1.0" encoding="UTF-8" project name="Compress CSS-JS" default="compress" basedir="." property file="bulid.properties" / path id="yuiClasspath" fileset dir="${lib}" include name="*.*" / /fileset /path !-- #######################Init the environment of the tool ##########################-- target name="init" echo message="begin to init the init" / echo message="delete all reference files." / delete dir="${output.dir}" / echo message="delete end" / echo message="make the reference files." / mkdir dir="${output.dir}" / mkdir dir="${output.temp.dir}" / echo message="make end." / /target !-- #######################Combine the css files ##########################-- target name="combinecss" depends="init" description="Combine common css files" echo message="begin to combine the css files to one file." / concat destfile="${output.temp.dir}/combined_css.css" encoding="UTF-8" append="false" fileset dir="${commonCss.dir}" include name="*.css" / /fileset /concat echo message="combine end." / /target !-- #######################Combine the js files ##########################-- target name="combinejs" echo message="begin to combine the js files to one file." / concat destfile="${output.temp.dir}/all_source.js" encoding="utf-8" append="false" fileset dir="${commonJs.dir}" include name="*.js" / /fileset /concat echo message="combine end." / /target !-- #######################Compress the js and css files ##########################-- target name="compress" depends="combinecss,combinejs" description="Compress" echo message="begin to compress the css file." / taskdef name="yuicompress" html' target='_blank'>classname="com.yahoo.platform.yui.compressor.YUICompressTask" classpath path refid="yuiClasspath" / /classpath /taskdef !-- first method compress the css files -- yuicompress linebreak="10000000" warn="false" munge="yes" preserveallsemicolons="true" outputfolder="${output.dir}" fileset dir="${output.temp.dir}" include name="*.css" / /fileset /yuicompress echo message ="compress the css end." / !-- second method compress the js files-- echo message ="begin to compress the js file." / apply executable="java" parallel="false" failonerror="true" fileset dir="${output.temp.dir}" includes="all_source.js" / arg line="-jar" / arg path="${lib}/yuicompressor-2.4.6.jar" / arg line="--charset utf-8" / arg line="-o ${output.dir}/combined_js.js" / srcfile / /apply echo message ="compress the js end." / delete dir="${output.temp.dir}" / /target /project @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
相關的文件我提供下載,感覺好的,就留言吧PHP教程

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 荥经县| 含山县| 南木林县| 柳州市| 岢岚县| 淳安县| 株洲市| 公安县| 迭部县| 屏南县| 岫岩| 驻马店市| 班玛县| 治县。| 沿河| 双城市| 横峰县| 北海市| 金阳县| 八宿县| 波密县| 靖远县| 冀州市| 沙雅县| 神农架林区| 土默特右旗| 黔江区| 乐亭县| 白水县| 读书| 泰安市| 昆明市| 韩城市| 英德市| 潼关县| 衡阳县| 三原县| 安平县| 吴江市| 扶沟县| 黄大仙区|