Closed SukkaW closed 1 year ago
The change is legit but wonder why you have the issue, also saw you’re using esModuleInterop": true,
in the tsconfig 🤔️
The change is legit but wonder why you have the issue, also saw you’re using
esModuleInterop": true,
in the tsconfig 🤔️
I don't know, but I guess it is caused by how rollup bundles the rollup.config.ts
. It looks like somehow rollup ignores the __esModule
convention.
rollup-plugin-dts
has the same issue as well: https://github.com/Swatinem/rollup-plugin-dts/issues/247
Ah looks like the official plugins are using a trick like https://github.com/rollup/plugins/blob/5ec2abe0325ed6b23bca26a5455d2a3b137e9e29/shared/rollup.config.mjs#L28
Which we don't have it, and --bundleConfigAsCjs
makes it resolved as cjs. Does it work if you remove that flag?
The default export breaks
rollup -c rollup.config.ts --configPlugin swc3 --bundleConfigAsCjs
: https://github.com/SukkaW/foxact/actions/runs/5567493053/jobs/10169409656The PR adds both named export and default export.