It was a pain, but rollup can export both if you write the source in esm. The part I find most annoying is exporting the typescript types. There's no tree-shaking for that!
Now with ESM if you write plain JS it works again. If you use Bun, it also works with TS straight away.