Skip to content

[Bug]: augmentChunkHash doesn't affect parent chunk's hash #3049

@hi-ogawa

Description

@hi-ogawa

Reproduction link or steps

reproduction: https://stackblitz.com/edit/github-czi3qh?file=README.md

In the reproduction, there are three chunks entry -> dep1 -> dep2 and augmentChunkHash is used to change dep2 chunk's hash for each build.

What is expected?

On rollup, it affect parent chunk's hash.

$ npm run build-rollup
[debug] [ 'entry-JLv7mwm2.js', 'dep1-BjiIigbx.js', 'dep2-FFxFXinQ.js' ]

$ npm run build-rollup
[debug] [ 'entry-DfZTTeuI.js', 'dep1-dlGUTxta.js', 'dep2-nUWkYB-M.js' ]

What is actually happening?

On rolldown, it affects only dep2 chunk.

$ npm run build
[debug] [ 'entry-CBcHEEV8.js', 'dep1-CN1ADQTv.js', 'dep2-CeH93yrm.js' ]

$ npm run build
[debug] [ 'entry-CBcHEEV8.js', 'dep1-CN1ADQTv.js', 'dep2-Bo3o0C0E.js' ]

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    rolldown: 0.15.0-snapshot-993c4a1-20241205003858 => 0.15.0-snapshot-993c4a1-20241205003858

Any additional comments?

I'm investigating test failures on rolldown vite https://github.com/vitejs/vite/blob/8773916797f8c0f53f3d7eef0542f1c8ffbb9121/packages/vite/src/node/__tests__/build.spec.ts#L63. I'm not sure if this test was working as intended with rolldown, but since v0.15, it became a clear (but flaky) failure.

Comparing with the tests on original Vite, I found the difference of hash and the behavior of augmentChunkHash in general.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions