Skip to content

[Bug]: Tree-shaking doesn't work with variable declarations having multiple declarators with circular dependent functions exported with an export list #10165

Description

@GulgDev

Reproduction link or steps

REPL that demonstrates the difference in behavior between using an export list and a named export declaration

What is expected?

It is expected that circular dependent functions declared in the same variable declaration are correctly eliminated if they are unused, regardless of whether they were exported using an export list or a usual named export declaration.

What is actually happening?

Rolldown does not eliminate functions exported with an export list.

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor             
    Memory: 41.89 GB / 63.91 GB
  Binaries:
    Node: 24.5.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 11.5.1 - C:\Program Files\nodejs\npm.CMD
    pnpm: 11.5.3 - C:\Program Files\nodejs\pnpm.CMD
    Deno: 2.5.4 - C:\Users\user\.deno\bin\deno.EXE
  Browsers:
    Chrome: 149.0.7827.201
    Edge: Chromium (150.0.4078.48)
    Firefox: 152.0 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.19041.5794
  npmPackages:
    rolldown: ^1.1.4 => 1.1.4

Any additional comments?

This is an edge case that was not covered in a PR that introduced multi-declarator tree-shaking (#1564).

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions