简体   繁体   中英

YUI remove javascript comments

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

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 */

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM