Skip to content

[Bug]: extended configs don't inherit plugins #13732

@joshcartme

Description

@joshcartme

System Info

System:
OS: Linux 6.6 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (32) x64 AMD Ryzen 9 7950X 16-Core Processor
Memory: 28.56 GB / 31.20 GB
Container: Yes
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 22.18.0 - ~/.nvm/versions/node/v22.18.0/bin/node
Yarn: 4.14.0 - ~/.nvm/versions/node/v22.18.0/bin/yarn
npm: 10.9.3 - ~/.nvm/versions/node/v22.18.0/bin/npm
bun: 1.3.10 - ~/.bun/bin/bun
Browsers:
Firefox: 149.0.2
Firefox Developer Edition: 149.0.2

Details

Extended configs do not concatenate plugins unless you use the undocumented '...' in the plugins array. Other than being undocumented it's problematic because it is a type error. The docs in https://rspack.rs/config/extends#multiple-configurations:~:text=Arrays%20are%20concatenated indicate that arrays are concatenated.

Reproduce link

https://github.com/joshcartme/rspack-plugins-extends-issue

Reproduce Steps

  1. yarn
  2. yarn rspack serve
  3. Observe that MyPlugin: The Rspack build process is starting! is in the output, but MyBasePlugin: The Rspack build process is starting! is not.
  4. yarn tsc -> no type errors
  5. In rspack.config.ts uncomment the ... in plugins.
  6. yarn rspack serve
  7. Observe that the output from both plugins is present.
  8. yarn tsc -> Type '"..."' is not assignable to type 'Plugin'.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions