graphile / crystal-pre-merge

Repository moved
https://github.com/graphile/crystal
39 stars 10 forks source link

Make sure all the TypeScript types are valid from both CJS and ESM #482

Open benjie opened 10 months ago

benjie commented 10 months ago

https://arethetypeswrong.github.io/?p=postgraphile%405.0.0-beta.6

ref https://blog.isquaredsoftware.com/2023/08/esm-modernization-lessons/

CJS default export CommonJS module simulates a default export with exports.default and exports.esModule, but does not also set module.exports for compatibility with Node. Node, and some bundlers under certain conditions, do not respect the esModule marker, so accessing the intended default export will require a .default property access on the default import.