Remapping Module URLs

Kevin Smith khs4473 at
Fri Aug 19 09:41:20 PDT 2011

Suppose that "jQuery2" is distributed as a single es-next module and I want
to distribute a module that depends on it.  I would expect to be able to
write something like this:

module jQuery2 from "";

export function whizBang() {
   /* Use jQuery2 */

The end user of this module may want to actually load the "jquery2" module
from somewhere else, though (perhaps from a CDN or locally).  If I
understand the module loaders proposal correctly, the user would need to
create a new loader to map the module url:

var MyLoader = SystemLoader.create(SystemLoader.intrinsics, {
    resolve: function(url) {
        if (url === "")
            return "/local-scripts/jquery2.js";
            return url;


Is that correct?

- khs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list