With Node.js 13.7.0 we finally have a standard way to make dual-packages which support both ESM and CJS with backwards compatibility with older Node.js versions, via conditional exports.
import foo from 'bar/module.mjs';).
Obviously nobody wants to write these out manually, but this presents some new challenges for transpilers, which unfortunately no transpilers have yet tried to solve.
So what can we do about this?
Necessity is the mother of pull requests, so that’s what I did.