openlayers/ol3 — pull request #2867 by tschaub (2014-10-23 22:49:52+00:00)
Title: Support for importing CommonJS style modules (like rbush)

This is a work in progress, based on @tsauerwein's work in #2863.

This adds a general purpose task for building external modules that are dependencies in our `package.json`.

Unfortunately, when I try to put something like `rbush` in the `ol.ext` namespace, the compiler begins to [complain](https://travis-ci.org/openlayers/ol3/builds/38873925) (`ERROR - {} expressions are not callable`). Oddly, this same problem doesn't come up when `rbush` is assigned to `window`. And I can't tell why.

I've tried adding casts in `src/ol/structs/rbush.js` and type annotations in `build/ol.ext/rbush.js`, but I can't find the right mix. I've pushed this branch to the `openlayers` repo in case anybody else wants to take a stab at it.