Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to extern chrome extensions API, to work with Closure compiler Advanced Optimization?

Is there an easy way to use advanced optimization on my Chrome extension's code?

It uses chrome API, and Advanced Optimization doesn't recongnize its keywords. Is there a file or something that externs all chrome API?

like image 962
Alejandro Silvestri Avatar asked Jul 20 '13 01:07

Alejandro Silvestri


1 Answers

Whenever you're in need of an externs file, take a look at the contrib/externs directory of the closure-compiler repository. The externs for Chrome extensions is found at contrib/externs/chrome_extensions.js, and can be used as follows:

// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @externs_url https://raw.githubusercontent.com/google/closure-compiler/master/contrib/externs/chrome_extensions.js
// ==/ClosureCompiler==

// Your code here.
like image 157
Rob W Avatar answered Oct 20 '22 18:10

Rob W