Skip to content
SPECIFICTION
Get listed

Google Closure Compiler vs ncc

Google Closure Compiler

developers.google.com

ncc

github.com

Side by side

FigureGoogle Closure Compilerncc
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
WindowsYes—
macOSYes—
LinuxYesYes
Self-hostedYes—
Plans published11
Spec score · JavaScript Build Tools8.1 (#6)8.2 (#5)
DistributionThe project page directs users to download a released JAR from Maven, and the repository README also documents Maven distribution.The README directs users to install ncc from npm as `@vercel/ncc`.
IntegrationsThe repository documents a NodeJS API and use through Maven, NPM, Bazel, and command-line Java.The package support guide gives configuration examples for Sequelize with MariaDB and for `@google-cloud/vision` with `google-proto-files`.
PurposeClosure Compiler optimizes JavaScript by analyzing it, removing dead code, rewriting and minimizing what remains, and checking syntax, references, and types.ncc is a CLI that compiles a Node.js module and its dependencies into a single file.

Plans

Google Closure Compiler

  • Closure CompilerFree

Google Closure Compiler pricing →

ncc

  • @vercel/nccFree

ncc pricing →

In their own words

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.

Visit developers.google.com

ncc

ncc is a free, MIT-licensed command-line tool for compiling a Node.js module and its dependencies into one file. It is distributed through npm as `@vercel/ncc`, with `npm i -g @vercel/ncc` given as the global installation command. The project targets publishing minimal npm packages and sending only relevant application code to serverless environments. Its design goals include zero configuration, built-in TypeScript support, and handling Node.js programs and npm modules. Inputs can include TypeScript, binary addons, and dynamic requires. Build options cover minification, source maps, watched builds, external modules, and ECMAScript target selection. Node.js programs can call ncc programmatically with options for caching, externals, minification, source maps, and asset builds. `.ts` and `.tsx` inputs require a `tsconfig.json`. Module-format behavior includes automatic ES module output for `.mjs` files and `.js` files inside a `type: module` package boundary. Support examples cover Sequelize with MariaDB and `@google-cloud/vision` with `google-proto-files`. Dynamically loaded assets that static analysis cannot identify may not work correctly. It runs on Linux.

Visit github.com