Is there a free open source JavaScript-to-JavaScript compiler (like Google)?

If you look at the source of Google pages using JavaScript, you will find that JavaScript is clearly not readable or supported. For example, all variables and functions have single-letter names (at least the first 26 are ...); no extraneous white spaces or lines; no comments; etc.

The advantages of this compiler are obvious: pages load faster, JavaScript execution is faster, and it will be difficult for competitors to understand your confusing code as a bonus.

Obviously, Google uses some kind of compiler to compile JavaScript-to-JavaScript. I am wondering if what they use is an internal tool? If not, which ones are they using? Are there any publicly available (ideally free / open) tools of this kind?

+3
source share
5 answers

YUI Compressor is a Java application that will be compact and confusing your Javascript code. This is a Java application that you run from the command line (and will probably be part of the build process).

PHP Minify, .

+7

ShrinkSafe, Dojo, ( script, , -): http://shrinksafe.dojotoolkit.org/

+2

, GWT - Java-JavaScript, JavaScript-JavaScript, .

, , , JavaScript-JavaScript. ( , , ... , :)

0

In fact, it is unlikely to be JS-> JS, especially since Java-> JS. These days, I believe that the recommended JS compressor (called for this) is the YUI compressor , but others like / packer / exist

0
source

Crockford.com JSMin is one step in that direction, assuming you're looking to minimize and not obfuscate.

0
source

Source: https://habr.com/ru/post/1703733/


All Articles