加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

使用YUI+Ant 实现JS CSS压缩

发布时间:2020-12-12 20:22:40 所属栏目:PHP教程 来源:网络整理
导读:今天研究了一下YUI yahoo开源框架,感觉很猛

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

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

copyright:Mr.chen

好了具体操作如下:

官网:

yuicompressor-2.4.6.jar 下载地址

YUIAnt.jar 下载地址

具体的相关代码如下:

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

相关的文件我提供下载,感觉好的,就留言吧

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读