Static Module Resolution

Kevin Smith khs4473 at
Mon Jul 2 07:19:08 PDT 2012

This solution is less ideal than being able to use import for legacy
modules, but gets mad points for simplicity.

The next question is this:  what will happen if "require" is used to load
an ES6 module (specifically, a module that contains import statements)?

Dave, is it possible to create an effectively synchronous loader using the
Loader API?

    let syncLoader = new Loader(parent, {

      fetch: function(relURL, baseURL, request, resolved) {
        let src = fetchSourceFromDisk(resolved);
        request.fulfill(src); // Fulfill in same turn of the event loop



    // Is ABC ready at this point?
    let ABC = syncLoader.get("abc");

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

More information about the es-discuss mailing list