error transfrom from ESM `export default` to CJS `module.exports`
Open
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
## issue
It will only transform `export default` to `module.exports` when
- the entry file has only `export default` without any `named export`
- with `splitting: true` and `cjsInterop: true` in the `tsup.config.ts`.
In other cases, it doesn't work.
## reproduction
https://github.com/LoTwT/tsup-cjs-default-export-issue
- pnpm i
- pnpm build
- node test.cjs
The result is false.
- remove the `export const fn` in the `index.ts`
- pnpm build
- node test.cjs
The result is true.
Contributor guide
Assessment
This issue has not been assessed yet.