Freedom251 › JavaScript Build Tools
Google Closure Compiler

What Google Closure Compiler is
Google Closure Compiler is a free JavaScript tool that analyzes code, removes dead code, rewrites and minimizes what remains, and checks syntax, references and types. Google says smaller JavaScript files can help applications load faster and reduce bandwidth needs. The compiler can also warn about invalid JavaScript, potentially dangerous operations and common pitfalls. Compilation options include WHITESPACE_ONLY, SIMPLE and ADVANCED; the repository also lists BUNDLE. ADVANCED_OPTIMIZATIONS uses aggressive transformations and renames symbols to improve compression, so preserving program behavior requires care. The project is available as a command-line Java application, a library used through Bazel, and an NPM package. A released JAR can be downloaded through Maven, and the repository documents Maven, NPM, Bazel, command-line Java and a NodeJS API. NPM packages are built and distributed by an open source contributor, not Google. Building the compiler requires Java 21 or later, NodeJS, Git and Bazelisk. The repository documents input restrictions, including use of goog.module() and goog.require(), and says ES6 import/export support is not actively maintained.
Who it suits
It suits developers who need to optimize and check JavaScript through a command-line tool, library or NPM package. Teams considering aggressive optimization should account for the need to preserve program behavior.
What it does well
- Offers multiple compilation levels
- Checks syntax, references and types
- Available through Java, Bazel and NPM
- Includes a NodeJS API
What to know first
- Building requires Java 21 or later, NodeJS, Git and Bazelisk
- Input restrictions include goog.module() and goog.require()
- ES6 import/export support is not actively maintained
- ADVANCED optimization requires care to preserve behavior
Limits
The tool is free, with no free trial. Its repository documents input restrictions, and ES6 import/export support is not actively maintained.
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| Closure Compiler | Open source Java application · Bazel library · NPM package | Free |
As developers.google.com lists them, read 4 Oct 2026. The maker's own page has the final word.
Getting started
- Visit https://developers.google.com/closure/compiler.
- Choose a command-line Java, Bazel library, or NPM route.
- For a released JAR, use the Maven distribution.
- For a source build, install Java 21 or later, NodeJS, Git, and Bazelisk.
- Select a compilation level for your JavaScript.
Verdict
Closure Compiler combines JavaScript optimization with code checks and offers several ways to integrate it into a workflow. Its documented input restrictions and maintenance status for ES6 import/export are worth considering before adoption.
Questions
How much does Google Closure Compiler cost?
It is free, with a listed price of $0.
What ways are there to use Closure Compiler?
The project describes a command-line Java application, a library used through Bazel, and an NPM package. The repository also documents Maven distribution and a NodeJS API.
Does Closure Compiler support TypeScript?
No. TypeScript support is listed as unavailable.
What does ADVANCED_OPTIMIZATIONS do?
It applies aggressive transformations and symbol renaming to improve compression. Preserving program behavior with this mode requires care.
What do I need to build Closure Compiler?
The repository lists Java 21 or later, NodeJS, Git, and Bazelisk as build requirements.
Where can users get help?
Google's FAQ points users to the Closure Compiler Discuss Group, Stack Overflow, and the FAQ.
Facts from Google Closure Compiler's own pages
- Advanced optimization
- ADVANCED_OPTIMIZATIONS can improve compression through aggressive transformations and symbol renaming, and requires care to preserve program behavior. · developers.google.com, 4 Oct 2026
- Build requirements
- The repository README lists Java 21 or later, NodeJS, Git, and Bazelisk as requirements to build the compiler. · github.com, 4 Oct 2026
- Code checking
- The compiler warns about illegal JavaScript, potentially dangerous operations, and common JavaScript pitfalls. · developers.google.com, 4 Oct 2026
- Compilation modes
- Available compilation levels include WHITESPACE_ONLY, SIMPLE, and ADVANCED; the repository README also lists BUNDLE. · github.com, 4 Oct 2026
- Distribution
- The project page directs users to download a released JAR from Maven, and the repository README also documents Maven distribution. · developers.google.com, 4 Oct 2026
- File efficiency
- Google says the compiler reduces JavaScript file size and can help applications load faster while reducing bandwidth needs. · developers.google.com, 4 Oct 2026
- Help
- Google’s FAQ directs users to the Closure Compiler Discuss Group, Stack Overflow, and the FAQ itself for help. · developers.google.com, 4 Oct 2026
- Integrations
- The repository documents a NodeJS API and use through Maven, NPM, Bazel, and command-line Java. · github.com, 4 Oct 2026
- Intended use
- The repository says Google projects use Closure Compiler to reduce JavaScript size, check code, support localization, transpile newer JavaScript features, and split output into loadable chunks. · github.com, 4 Oct 2026
- JavaScript restrictions
- The repository says Closure Compiler places restrictions on input, including use of goog.module() and goog.require(), and that ES6 import/export support is not actively maintained. · github.com, 4 Oct 2026
- NPM package
- The repository README states that NPM packages are built and distributed by an open source contributor, not by Google. · github.com, 4 Oct 2026
- Purpose
- Closure Compiler optimizes JavaScript by analyzing it, removing dead code, rewriting and minimizing what remains, and checking syntax, references, and types. · developers.google.com, 4 Oct 2026
- Security and compliance
- The project page links to the Apache 2.0 license for code samples; it does not state a security certification or compliance standard. · developers.google.com, 4 Oct 2026
- Ways to use
- The project page describes an open source command-line Java application, a library used via Bazel, and an NPM package. · developers.google.com, 4 Oct 2026
Where Google Closure Compiler stands on Freedom251
- JavaScript Build Tools#2 of 27