ECMAScript modules
It can be complicated, but here are some links to help you shift through it.
- Pure ESM package: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
- https://github.com/MylesBorins/node-osc
- https://github.com/d3/d3/issues/3469
- https://dev.to/bnb/conditional-exports-supporting-both-import-and-require-3ihg
- https://github.com/microsoft/TypeScript/issues/33079
- https://twitter.com/rauschma/status/1419468156624637954
- https://twitter.com/jefflembeck/status/1431364465698557956
- import maps: https://twitter.com/MylesBorins/status/1430251050196471816
- esm can cjs but not vice versa https://mobile.twitter.com/Rich_Harris/status/1441071762054201344
- Devon Govett on Twitter: “I’m trying to implement support for the package.json
exports
field in Parcel, and honestly I can’t even figure out how it is supposed to work. The ESM package ecosystem is such an over complicated mess. Wish we could just avoid the whole thing. 😡” / Twitter - https://github.com/endojs/endo-e2e-tests/blob/main/matrix/table.md
- https://github.com/naugtur/research/blob/main/package-exports/behavior/summary.md
https://twitter.com/matteocollina/status/1512885705181179910 https://github.com/fastify/fastify/blob/9ffb9fa38b564953208672456dd08586bedc2933/fastify.js#L715