YUI删除javascript评论 [英] YUI remove javascript comments

查看:116
本文介绍了YUI删除javascript评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从一些Javascript代码中删除评论(//这是一条评论,如评论),我使用YUI压缩程序,有一个选项吗?

I need to remove comments (the "// This is a comment" like comments) from some Javascript code, I'm using YUI compressor, there is an option to do that?

感谢

感谢回复,我试图合并几个脚本, YUI;我发现如果我压缩,然后合并脚本它的工作,但如果我合并,然后压缩,出现问题,我有一个破碎的脚本

Thanks for the response, I'm trying to merge several scripts and after compress with YUI; I've found if I compress and then merge the scripts it works, but if I merge and then compress, something goes wrong and I got a broken script

推荐答案

YUI Compressor默认删除注释。您必须使用特殊注释格式保留注释。

YUI Compressor removes comments by default. You have to use a special comment format to keep comments.

/*! This comment will not be removed, so it's a good place to put a copyright */

// this comment will be removed

/* this one too */

这篇关于YUI删除javascript评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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