Skip to content

Non-entry .ts files export objects by default, resulting in mismatched type file formats when packaged. #205

@btea

Description

@btea

Reproduction link or steps

https://github.com/btea/rolldown-dts-issue

Describe the bug

Referring to the packaged code shown in the reproduction link, the exported type in the generated .d.ts file should also be the default export.

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 3.55 GB / 15.86 GB
  Binaries:
    Node: 22.21.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.4 - C:\Program Files\nodejs\npm.CMD
    pnpm: 10.31.0 - C:\Users\admin\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Chrome: 146.0.7680.71
    Edge: Chromium (142.0.3595.69)
    Firefox: 148.0 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.19041.5794

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

Compensating engineering work will speed up resolution and support the project

  • I'm willing to offer $16 for financial support

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions