Skip to content

Types in d.cts is incorrect when the entry has multiple exports #531

@sapphi-red

Description

@sapphi-red

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions