Skip to content

Commit 7912459

Browse files
authored
perf: define viteMetadata instead of assign (#106)
1 parent 8646e4e commit 7912459

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/vite/src/node/build.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,11 @@ function injectChunkMetadata(
13591359
__modules: chunk.modules,
13601360
})
13611361
}
1362-
chunk.viteMetadata = chunkMetadataMap.get(key)
1362+
// define instead of assign to avoid detected as a change
1363+
// https://github.com/rolldown/rolldown/blob/f4c5ff27799f2b0152c689c398e61bc7d30429ff/packages/rolldown/src/utils/transform-to-rollup-output.ts#L87
1364+
Object.defineProperty(chunk, 'viteMetadata', {
1365+
value: chunkMetadataMap.get(key),
1366+
})
13631367
Object.defineProperty(chunk, 'modules', {
13641368
get() {
13651369
return chunk.viteMetadata!.__modules

0 commit comments

Comments
 (0)