- Notifications
You must be signed in to change notification settings - Fork253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Migrate to named exports and provide node esm support#241
base:main
Are you sure you want to change the base?
Conversation
In this diff I added new entry point to compile es modules with namedexports to solve this problem (json5#240).It's a breaking change so we can drop legacy node support (newerversions of rollup and many other tools requires this) and add nativenode es modules support.
Thank you for this PR, but I think it adds too much complexity compared to#243. Instead of one entry point ( There is also a You've also removed the |
esm.js is used only for building proper exports in dist/index.mjs because generating exports from commonjs is not reliable and may change with rollup upgrade. I do not suggest to remove dist/index.mjs. "module" is bundler specific field. "exports" is node specific way to support es modules natively. Probably only webpack 5 support both them yet. Here's example "browser" field should not just point to umd. Bundlers prefer "browser" field over over "module" when specified as a string. This makes "module" field useless in this case. See the correct use case for "browser" fieldhttps://github.com/visgl/react-map-gl/blob/master/package.json#L17-L25 |
In this diff I added new entry point to compile es modules with named
exports to solve this problem (#240).
It's a breaking change so we can drop legacy node support (newer
versions of rollup and many other tools requires this) and add native
node es modules support.