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
{{ message }}
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.
Now when Node has support for modules, some packages started to care about ESM version.
It turns out the "module" field isn't always the best solution, because of webpack.
See for example this PR where it was decided to remove it: markedjs/marked#1571 (comment)
@FredKSchott would you consider adding more ways to discover ESM packages?
This is important for me as a library maintainer: I was hoping to get @pika/web and CDN support when upgrading to ESM version of dependency, but so far I'm out of luck.
The text was updated successfully, but these errors were encountered:
Module field is OK - the only thing you have to do to make it work is to expose the same shape from each format. If that requires a major bump on your side because of CJS consumers then just do it. Yes - it will be a little bit worse for CJS consumers because they will have to either use .default or destructure named export which is less than ideal bit its really not that bad in the end. The difference is just visual so it’s better to get over it and start shipping stuff instead of hanging to a possibility to export a single thing from CJS in a flat~ manner (whereas in ESM you always export a bag of things).
Now when Node has support for modules, some packages started to care about ESM version.
It turns out the
"module"
field isn't always the best solution, because of webpack.See for example this PR where it was decided to remove it: markedjs/marked#1571 (comment)
Also I found this article relevant: https://2ality.com/2019/10/hybrid-npm-packages.html
@FredKSchott would you consider adding more ways to discover ESM packages?
This is important for me as a library maintainer: I was hoping to get
@pika/web
and CDN support when upgrading to ESM version of dependency, but so far I'm out of luck.The text was updated successfully, but these errors were encountered: