unbuild
unbuild copied to clipboard
Types in `d.cts` is incorrect when the entry has multiple exports
Environment
Node 22.15.0 unbuild 3.5.0
Reproduction
https://stackblitz.com/edit/node-vefv5aqh?file=package.json,build.config.ts&terminal=build
Describe the bug
The CJS output has
exports.default = d;
exports.foo = foo;
but the types (index.d.cts, index.d.ts) has
export = d;
export { foo };
I think the correct type for this CJS file is:
export = { default: d, foo }
Additional context
I guess the related changes are #458 and #513
Logs