Node.js: ESM/CJS dual package – best practices to avoid ecosystem breakage?
Maintainers: What’s the most reliable setup for publishing a dual ESM/CJS package in 2025 without breaking consumers?
Questions:
- Preferred
package.jsonfields (type,exports,main) arrangement? - Do you recommend separate builds and conditional exports per environment?
- How to avoid TS/TS-Node, Jest, and bundlers choking on mixed module formats?
Looking for a minimal, robust template that works with Node 18+, Vite, Jest, and TS.
0