Closure Compiler
Closure Compiler: JavaScript Optimizing Compiler
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.
What is Closure Compiler?
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.
Closure Compiler Features
Features
- Minifies JavaScript code by removing whitespace, comments and unused code
- Performs optimizations like inlining variables, dead code elimination and function optimizations
- Provides advanced compilation modes for more aggressive optimizations and code transformations
- Can rewrite code to use more modern JavaScript syntax and features
- Integrates with build tools like Grunt, Gulp and webpack
- Can be run through a web interface, Node.js API or Java API
Pricing
- Free
- Open Source
Pros
Cons
Reviews & Ratings
Login to ReviewThe Best Closure Compiler Alternatives
View all Closure Compiler alternatives with detailed comparison →
Top Development and Javascript and other similar apps like Closure Compiler
Here are some alternatives to Closure Compiler:
Suggest an alternative ❐YUI Compressor
JavaScript Obfuscator
UglifyJS