whatisgithub

What is closure-compiler?

gaearon/closure-compiler — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2017-11-07

2JavaAudience · developerComplexity · 3/5DormantSetup · moderate

In one sentence

Google's tool that analyzes and rewrites JavaScript to make it smaller, faster, and catch bugs before they reach production.

Mindmap

mindmap
  root((repo))
    What it does
      Shrink JavaScript files
      Remove unused code
      Catch type errors
      Rewrite for speed
    Tech stack
      Java
      JavaScript
      Command line tool
    Use cases
      Optimize large JS bundles
      Catch bugs before production
      Speed up page loads
    Audience
      Web developers
      Large app teams
    Requirements
      Java 8 plus
      Maintained by Google

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Shrink a large JavaScript codebase by 30-50% for faster page loads.

USE CASE 2

Catch type errors and misspelled variables before code ships to production.

USE CASE 3

Add automatic JavaScript optimization to a build pipeline via the command line.

USE CASE 4

Remove dead code paths that aren't actually used by the application.

What is it built with?

JavaJavaScriptCLI

How does it compare?

gaearon/closure-compilerdavorpa/musical-surveyor-springboot-apikristitrnka/spectra
Stars222
LanguageJavaJavaJava
Last pushed2017-11-072023-09-25
MaintenanceDormantDormant
Setup difficultymoderatemoderatemoderate
Complexity3/53/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Java 8 or higher installed to run the compiler.

Copy-paste prompts

Prompt 1
Show me how to run this compiler from the command line on my own JavaScript files.
Prompt 2
Explain what optimizations this tool applies beyond simple minification, like dead code removal.
Prompt 3
Help me add Closure Compiler's type-checking step to my existing build process.
Prompt 4
Walk me through the example where var x = 17 + 25 gets compiled down to var x=42.

Frequently asked questions

What is closure-compiler?

Google's tool that analyzes and rewrites JavaScript to make it smaller, faster, and catch bugs before they reach production.

What language is closure-compiler written in?

Mainly Java. The stack also includes Java, JavaScript, CLI.

Is closure-compiler actively maintained?

Dormant — no commits in 2+ years (last push 2017-11-07).

How hard is closure-compiler to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is closure-compiler for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.