You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new here (both at this repo and with ES modules in general), but I was reading through the blog posts and I think I would also be unhappy with the .mjs solution. Mainly because of syntax highlighting, but also because it would be impossible to serve a single file to the server and the browser, since browsers don't know .mjs (some utility scripts could be useful on both front and back ends). I would much prefer to keep .js.
I like the idea of using metadata in a package file to indicate modules, but I was wondering…
module.json would be for ESM what package.json is for CJS. In order to be a non-breaking change, Node could learn to look for this new file, and if both files are present, module.json would take precedence over package.json. Years into the future, when CJS is dead, module.json would be the new standard. Any thoughts on this?
The text was updated successfully, but these errors were encountered:
I like the premise here. If module.json is to take over all the responsibilities of package.json then there is a risk of a lot of duplication though as interim packages will likely need both.
One approach might be to have module.json for the module directives ("main", "browser" etc), and package.json for dependency information, which unfortunately then seems like a further fragmentation without an easy deprecation path.
It seems like the right kind of thinking, but I don't see it catching unfortunately for these reasons.
I'm new here (both at this repo and with ES modules in general), but I was reading through the blog posts and I think I would also be unhappy with the
.mjs
solution. Mainly because of syntax highlighting, but also because it would be impossible to serve a single file to the server and the browser, since browsers don't know.mjs
(some utility scripts could be useful on both front and back ends). I would much prefer to keep.js
.I like the idea of using metadata in a package file to indicate modules, but I was wondering…
module.json
would be for ESM whatpackage.json
is for CJS. In order to be a non-breaking change, Node could learn to look for this new file, and if both files are present,module.json
would take precedence overpackage.json
. Years into the future, when CJS is dead,module.json
would be the new standard. Any thoughts on this?The text was updated successfully, but these errors were encountered: