Building an NPM module
I just went through the painful process of updating an old NPM module to build ESM & CJS dists, with DTS files, and a CLI. It was bad. In summary:

I ended up using TSUP. It was a frustrating experience. I think the real root of the frustration is:
- Most modules like this need
.dtsfiles, so that people who import from them have TypeScript types. - The TypeScript team has bizarrely refused to implement dts tooling to TypeScript.
- All the third-party plugins are, as a result, kind of grumpy that they're reimplementing things with TypeScript internals that TypeScript should be doing itself, so they're all pretty burned out, it seems.
So, using esbuild is great, but if you're distributing a library, you probably need esbuild-plugin-d.ts, which is not very adopted and even the maintainer warns you away from using it. So it's kind of all stuck.