Skip to content

[Bug]: unsafe defaults for cache.buildDependencies #7059

@escaton

Description

@escaton

Version

System:
    OS: macOS 15.7.2
    CPU: (14) arm64 Apple M4 Pro
    Memory: 1.16 GB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Browsers:
    Chrome: 144.0.7559.97
    Firefox: 147.0.1
    Safari: 26.1
  npmPackages:
    @rsbuild/core: 1.7.2 => 1.7.2 
    @rsbuild/plugin-type-check: 1.3.3 => 1.3.3 
    @rsbuild/plugin-vue: 1.2.3 => 1.2.3

Details

https://rsbuild.rs/config/performance/build-cache#default-value
Currently the cache depends on package.json among other files, but not on any of the lock files such as package-lock.json, pnpm-lock.yaml, yarn.lock etc. This makes it possible to mistakenly reuse cache while actual content of node_modules could be different.

Proposal: add known popular lock files to the buildDependencies: npm, pnpm, yarn, bun.

Reproduce link

Reproduce Steps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions