admin管理员组文章数量:1202803
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?
Thanks
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
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?
Thanks
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
Share Improve this question edited Aug 25, 2010 at 12:43 gurbieta asked Aug 23, 2010 at 13:25 gurbietagurbieta 8961 gold badge8 silver badges22 bronze badges 3- 1 I merge then compress in my project and it works just fine. Do your scripts rely on lots of global variables and global functions? Maybe that's creating a problem for the compressor. How is it "broken"? – Pointy Commented Aug 25, 2010 at 12:51
- the recommended way is to MINIFY each file first, then combine them secondly. Not the other way around. Is there any reason why you can't Minify then Combine? – Pure.Krome Commented Sep 24, 2010 at 12:09
- @Pure.Krome Could you explain why it's recommended to minify before combining? I have an active question on this topic – AlliterativeAlice Commented Nov 5, 2013 at 22:02
1 Answer
Reset to default 26YUI 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 remove javascript commentsStack Overflow
版权声明:本文标题:YUI remove javascript comments - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738573657a2100748.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论