>
>
> We then conditionally add this wrapper based on detecting if the import is
> an ES6 module. This is the same method we have for AMD compilations at the
> moment, which seems to have been working well.
>

Just a side note, but for performance reasons in a real runtime system you
can't pre-determine whether the target is an ES6 module or not - that would
imply double-parsing and would necessarily be heuristic and incomplete.

In the end, either the import side or some preconfigured application state
will have to explicitly specify which targets are ES6 and which are not.

I've worked though most of these issues already in es6now, which provides a
complete picture of a backward compatible ES6 module system running on Node.

https://github.com/zenparsing/es6now/blob/master/docs/modules.md
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to