Support loading the Closure Compiler default browser environment externs

Issue #5 new
Marcin Szczepanski created an issue

When the Closure Compiler is run via the CLI it includes a bunch of "externs" which are type definitions for the Browser APIs.

Without these externs it's possible for some code to fail to compile. For example, this line of code in isolation (from the lodash 3.x bundle) fails without externs:

var freeWindow = objectTypes[typeof window] && window && window.Object && window;

However the problem is that currently we create a compiler instance for every file to be minified. The overhead of loading externs makes this infeasible to do. We'd need to refactor the Minifier to be able to take a list of files to minify. This would have other implications as we would probably need to load all of the sources (unless they're streamable?).

In any case, this isn't an issue for our own code just third party libraries and we are working around this by using a pre-minified bundle.

Comments (0)

  1. Log in to comment