Vite 8 released last week. See vitejs/vite#21890 for context. I respect #432 being rejected. I just wanted to contribute to the discussion, and hopefully one day we get to a point where you would consider publishing as esm.
When using Rolldown, which Vite uses as bundler, it is recommended for each library to not export default from a cjs file.
For now, inconsistentCjsInterop: true does work by restoring the old behavior. However, this is deprecated as per the migration guide. So one day it won't.
export default defineConfig({
legacy: {
inconsistentCjsInterop: true,
},
});