使用YUI+Ant 实现JS CSS压缩

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了使用YUI+Ant 实现JS CSS压缩脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

今天研究了一下YUI yahoo开源框架,感觉很猛啊。

于是乎我做了一个YUI的ant实现,网上好多关于bat的实现,我就另辟蹊径,出个关于这个的ant实现,嘿嘿独一无二的文章,如果转载的话,其注明作者和网站

copyright:Mr.chen

好了具体操作如下:

官网:

yuicompressor-2.4.6.jar 下载地址

YUIAnt.jar 下载地址

具体的相关代码如下:

PHP;">
#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=".">

<path id="yuiClasspath">
<fileset dir="${lib}">

<target name="init">

<target name="combinecss" depends="init" description="Combine common css files">

<target name="combinejs">

<target name="compress" depends="combinecss,combinejs" description="Compress">

@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压缩全部内容,希望文章能够帮你解决使用YUI+Ant 实现JS CSS压缩所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:CSS