Running Closure compiler locally

You can locally test that your code compiles on Linux or Mac. This requires Java and a Chrome checkout (i.e. python, depot_tools). Note: on Ubuntu, you can probably just run sudo apt-get install openjdk-7-jre.

After you set closure_compile = true in your gn args, you should be able to run:

Externs

Externs files define APIs external to your JavaScript. They provide the compiler with the type information needed to check usage of these APIs in your JavaScript, much like forward declarations do in C++.

Third-party libraries like Polymer often provide externs. Chrome must also provide externs for its extension APIs. Whenever an extension API's idl or json schema is updated in Chrome, the corresponding externs file must be regenerated: