import script --> .esm

Kevin Smith zenparsing at gmail.com
Wed Sep 10 10:23:08 PDT 2014


>
>
> In NodeJS, this can be through `package.json` properties which inform what
> module format the package is.
>

Right - although having a runtime system looking at json config files is a
terrible idea.  : )  In es6now, I'm experimenting with the following rule:

- If some folder that might be a "package" contains a "default.js" file,
then load it as an ES6 module/package.
- Otherwise, use the old-school algorithm (package.json or index.js).

In any case, it makes sense (when possible) to make the module vs. script
decision at package boundaries.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140910/694893f2/attachment.html>


More information about the es-discuss mailing list