The problem is that you can import commonjs modules in ESM but not the other way around. For stepci (https://stepci.com) we have chosen to not support ESM for this very reason. We want that the library “just works” for all our users
Everything should be published as standard modules at this point.
Basically we will have to move the library to ESM and then use a bundler like esbuild to compile it to CJS as well for compatibility. It’s a mess
I think everyone agrees about this.
What people can’t agree about is how to fix it.
Maybe an aversion to bundlers exists, but I think tsup and vite are great and simple. We have turbopack on the horizon too.
For small projects I don’t even need a configuration file for tsup to target both formats. For larger more complex projects vite configs tend to be under 50 LoC.