Dual Publishing ESM and CJS Modules with tsup and Are the Types Wrong?
If you need to publish a package that supports both ECMAScript modules (ESM) and CommonJS modules (CJS), you can use tsup
to do so. This post will show you how to do that and how to ensure that the types are correct using the tool Are the Types Wrong?
.