Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any tools for automatic removal of comments from JavaScript code?

I'd like to have comments in my code, but I want them to be removed before deploying. Yes, it's not hard to write such a thing, but if it already exists… And how about comments in ASP pages?

like image 709
z-boss Avatar asked Dec 13 '22 06:12

z-boss


2 Answers

YUI Compressor in addition to removing comments and white-spaces, obfuscates local variables using the smallest possible variable name...

Besides the utility, there is the YUI Compressor Library for .NET, this library allows you to programmatically compress JavaScript and CSS, or use it automatically with MsBuild...

like image 117
Christian C. Salvadó Avatar answered Mar 23 '23 00:03

Christian C. Salvadó


Sounds like you are looking for a JSMin tool or similar.

There are many tools which you can purchase, but there are also some online tools you can use:

http://www.askapache.com/tools/online-compression-tool-compares-packer-jsmin-dojo-and-yui-compressor.html

http://www.askapache.com/online-tools/js-compress/

Good Luck!

like image 35
Jason Stevenson Avatar answered Mar 23 '23 00:03

Jason Stevenson