On 10 September 2014 19:23, Kevin Smith <[email protected]> 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.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to