Closure Compiler is a JavaScript optimizing compiler developed by Google. It analyzes and transforms JavaScript code to make it load faster, run faster, and make it smaller. It removes unused and dead code, checks syntax, rewrites and optimizes code.
Closure Compiler is an open-source JavaScript optimizing compiler developed and maintained by Google. Its goal is to make JavaScript code run more efficiently and load faster without losing functionality.
It parses JavaScript code, analyzes it, removes unused and dead code, checks syntax errors, rewrites and optimizes the code. Some of the optimizations include inlining functions and variables, dead code removal, reordering function declarations, and more to make the output code execute faster.
The compiler provides three levels of compression - WHITESPACE_ONLY to remove whitespaces, SIMPLE_OPTIMIZATIONS for basic optimizations, and ADVANCED_OPTIMIZATIONS for the highest level of minification. The more optimization, the smaller the output code is but it also gets harder to debug and understand.
Closure Compiler is very popular in production use by large web applications like Gmail, Google Analytics, Google Maps etc to reduce bandwidth usage and improve performance. It can be used via its CLI, programmatically using Java APIs or through its web interface.
Here are some alternatives to Closure Compiler:
Suggest an alternative ❐