Skip to content

[Bug]: When dts is enabled, chunks are generated even when codeSplitting=false #8501

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 (like tsdown) rather than rolldown, please let me know and I will open an issue in that repository.

What is expected?

single file, no chunks.

What is actually happening?

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: 10.41 GB / 15.15 GB
    Container: Yes
    Shell: 5.9 - /home/linuxbrew/.linuxbrew/bin/zsh
  Binaries:
    Node: 24.13.0 - /run/user/1000/fnm_multishells/21886_1772342545583/bin/node
    npm: 11.6.2 - /run/user/1000/fnm_multishells/21886_1772342545583/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
  npmPackages:
    rolldown: ^1.0.0-rc.6 => 1.0.0-rc.6

Any additional comments?

I have already filed a bug issue in the dts plugin repository and received a response that there is no way to fix it within the plugin.
sxzz/rolldown-plugin-dts#195

Metadata

Metadata

Assignees

No one assigned

    Fields

    Priority

    None yet

    Start date

    None yet

    Target date

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions