Module Interop

Jason Orendorff jason.orendorff at
Thu Mar 21 13:32:20 PDT 2013

On Thu, Mar 21, 2013 at 12:25 PM, Kevin Smith <khs4473 at> wrote:

> The problem is that the `options.metadata === "node"` test is
> hand-waiving.  In a mixed environment where a module may be an ES6 module
> or a legacy Node module, how is the loader supposed to know how to link it?
>  Ideally, everything will "just work", so that legacy modules can be used
> transparently alongside ES6 modules.

Some alternatives to parsing the whole file:
- look for a special comment at the beginning
- look at the module name
    import "npm/moment" as moment;
- look at package metadata etc. that is available to your custom module

I think that's probably enough and we can get by without another hack, but
what do you think?

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

More information about the es-discuss mailing list