esbuild vs Google Closure Compiler
esbuild
esbuild.github.ioGoogle Closure Compiler
developers.google.comSide by side
| Figure | esbuild | Google Closure Compiler |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Web | Yes | — |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| Android | Yes | — |
| API | Yes | — |
| Self-hosted | Yes | Yes |
| Plans published | 1 | 1 |
| Spec score · JavaScript Build Tools | 8.4 (#3) | 8.1 (#6) |
| Integrations | The FAQ names Vite, Amazon CDK, and Phoenix as projects that use esbuild. | The repository documents a NodeJS API and use through Maven, NPM, Bazel, and command-line Java. |
| Purpose | esbuild is an extremely fast bundler for the web designed to improve build tool performance and be easy to use. | Closure Compiler optimizes JavaScript by analyzing it, removing dead code, rewriting and minimizing what remains, and checking syntax, references, and types. |
Plans
In their own words
esbuild
esbuild is a free bundler for web projects, designed to improve build-tool performance while remaining easy to use. It bundles ESM and CommonJS modules, including CSS modules, with built-in support for JavaScript, CSS, TypeScript and JSX. Optimization features include tree shaking, minification and source maps; development tools include a local server, watch mode and plugins. Developers can use the command-line, JavaScript or Go interface. The recommended installation is the native executable installed with npm. An alternative WebAssembly package works across platforms, though it can be substantially slower than the native package. esbuild is MIT-licensed. It does not type-check TypeScript, and its FAQ recommends running tsc separately. The FAQ describes code-splitting support as primitive. The maintainer says the project receives periodic releases and is maintained, but active feature development is not underway. The FAQ also notes that a project primarily built by one developer may not fit organizations seeking a larger or more active community.
Google Closure Compiler
Google Closure Compiler optimizes JavaScript by analyzing code, removing dead code, and rewriting and minimizing what remains. It can also check syntax, references, and types, and warn about illegal JavaScript, risky operations, and common pitfalls. Google says smaller output files can help applications load faster and reduce bandwidth needs. Compilation options include WHITESPACE_ONLY, SIMPLE, and ADVANCED; the repository README also lists BUNDLE. ADVANCED applies aggressive transformations and symbol renaming 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. Released JARs are distributed through Maven. The repository documents Maven, NPM, Bazel, command-line Java, and a NodeJS API. Building the compiler requires Java 21 or later, NodeJS, Git, and Bazelisk. Its input restrictions include use of goog.module() and goog.require(), and ES6 import/export support is not actively maintained. The NPM packages are built and distributed by an open source contributor, not Google. The compiler is free.