我需要在构建itel时构建war文件时删除注释,从而优化javaScript文件. [英] I need to optimize my javaScript file by removing comment while building war file usin ant at the time of builing itsel

查看:81
本文介绍了我需要在构建itel时构建war文件时删除注释,从而优化javaScript文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建自身时,我需要通过在构建war文件时删除注释和空格来优化javaScript文件.但是,原始资源不应该更改,只有在最终战争中的脚本文件才应该进行优化....任何人都可以让我知道执行此操作的方法吗?

I need to optimize my javaScript file by removing comments and spaces while building war file usin ant at the time of builing itself. But the original source should not be changed and only the script files in the resultant war should be optimized.... Can any one let me know the way to do this...

推荐答案

您可以使用 YUI压缩 [ [
You could use YUI compress[^] and a custom nant build step[^] to perform the compression

In the example above, for your scenario you wouldn''t want the last step which overwrites the original file, but this should give you some ideas


这篇关于我需要在构建itel时构建war文件时删除注释,从而优化javaScript文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆