Skip to content

When dts is enabled, chunks are generated even when codeSplitting=false #195

Description

@phi-friday

Reproduction link or steps

I created a repository that reproduces the bug. Please refer to the code in that repository.
repro-rolldown-chunk-bug

This repository uses bun and tsdown. If you determine that this is an issue with another library (rolldown or tsdown) rather than the dts plugin, please let me know and I will open an issue in that repository.

Describe the bug

I'm generating a single bundle file together with dts. However, chunks are only created when dts is enabled.

A virtual entry is being added via emitFile, and it seems rolldown recognizes it as multiple entries. Because of this, __defProp and __exportAll appear to be extracted into a separate chunk. For now I'm fixing it using plugin, but I don't think this is the correct approach.

System Info

System:
    OS: Linux 6.6 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
    CPU: (16) x64 AMD Ryzen 7 7800X3D 8-Core Processor
    Memory: 5.78 GB / 15.15 GB
    Container: Yes
    Shell: 5.9 - /home/linuxbrew/.linuxbrew/bin/zsh
  Binaries:
    Node: 24.13.0 - /run/user/1000/fnm_multishells/1766_1772249235393/bin/node
    npm: 11.6.2 - /run/user/1000/fnm_multishells/1766_1772249235393/bin/npm
    pnpm: 10.28.2 - /home/phi/.local/share/pnpm/pnpm
    bun: 1.3.10 - /home/phi/.bun/bin/bun
  Browsers:
    Chrome: 142.0.7444.59

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

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions