Skip to content

[Bug]: output array results in multiple build runs #3274

@nstepien

Description

@nstepien

Reproduction link or steps

https://stackblitz.com/edit/github-vwaxybzu?file=src%2Ftest.js,rolldown.config.mjs

  1. set up an output array with 2+ build outputs
  2. run the build
  3. check how many times the console.log() in the plugin's transform is called

What is expected?

Code should only be transformed once: console.log should only be called once in the example.

What is actually happening?

Code is transformed once per output: console.log is called once per output in the example.

System Info

System:
    OS: Windows 11 10.0.26100
    CPU: (64) x64 AMD Ryzen Threadripper 3970X 32-Core Processor
    Memory: 10.66 GB / 31.88 GB
  Binaries:
    Node: 23.5.0 - C:\Program Files\nodejs\node.EXE
    npm: 11.0.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (131.0.2903.99)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    rolldown: ^1.0.0-beta.1 => 1.0.0-beta.1

Any additional comments?

Rollup does not have this issue: there are no additional transform runs for example. There is only 1 full build.

Rolldown seems to be doing 1 full build per output item, which slows it down.

This is a follow-up to #3200

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions