Inspired by https://github.com/knightedcodemonkey/duel but much simpler.
Use raw typescript to get dual ESM/CJS build, no bundler needed.
For this package to work, all imports must be CJS, ESM only imports will break the CJS build.
- Takes your ESM project and copies the whole thing to a temp dir.
- Renames all your ts files cts file
- runs typescript build again
- copies the build back into the original directory