import script --> .esm

Guy Bedford guybedford at gmail.com
Wed Sep 10 10:56:08 PDT 2014


On 10 September 2014 19:23, Kevin Smith <zenparsing at gmail.com> wrote:

>
>> 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:
>

Why would it be a terrible idea to read the package.json as part of a
server-based import mechanism?


>
> - 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).
>

Interesting idea, but there may be backwards-compatibility issues.


>
> In any case, it makes sense (when possible) to make the module vs. script
> decision at package boundaries.
>

It certainly helps.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140910/7b6dc15e/attachment.html>


More information about the es-discuss mailing list