Just my 2 cents/anecdata in response to your tweet about what library authors have to put up with, hoping it helps some of the doomers replying:
> Build artifact formats (ESM, CJS, UMD)
I don't know anyone that ever used AMD/UMD. CJS is loadable in ESM, and tsup makes the two of them trivial.
> > Matrixed with: dev/prod/NODE_ENV builds
Not every library has this issue.
> Bundled or individual .js per source
Not a new issue, this has always been a toss up (I prefer .js per source)
> exports setup
Yup this is a pain, especially because I prefer multiple .js files, and I wish tsup would help here.
> Webpack 4 limits
I'm not sure what you mean by webpack not understanding optional chaining syntax, we use webpack 4 and use it all the time. Might be a benefit of using typescript.
And tsup helps with the .js requirement issue.
> TS moduleResolution options
Again it looks like tsup solves this.
> User environments
When is that ever not an issue? Very fair for maintainers to say "nope, sorry, that's too esoteric an environment"
> TS typedef output (bundled? individual? .d.ts, or .d.mts?)
Should match your .js file output 1:1 (.cjs/.mjs et al)
---
All that to say, if you use typescript and don't do anything fancy, you've got a pretty compatible library with just `tsc`
And if you're looking to do something cross compatible, tsup will help a lot.