Module Interop

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


On Thu, Mar 21, 2013 at 12:25 PM, Kevin Smith <khs4473 at gmail.com> 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
loader

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

-j
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130321/49b1a5d5/attachment.html>


More information about the es-discuss mailing list