From ea18a265641207d747db0d2f1d397b71f433c88f Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Tue, 17 Jun 2025 11:15:24 +0900 Subject: [PATCH] fix: set viteMetadata for `writeBundle` hook --- packages/vite/src/node/build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/build.ts b/packages/vite/src/node/build.ts index 086e2d2d69b585..053455b818dfc6 100644 --- a/packages/vite/src/node/build.ts +++ b/packages/vite/src/node/build.ts @@ -1317,7 +1317,7 @@ function wrapEnvironmentHook( if (hookName === 'augmentChunkHash') { injectChunkMetadata(chunkMetadataMap, args[0]) } - if (hookName === 'generateBundle') { + if (hookName === 'generateBundle' || hookName === 'writeBundle') { const bundle = args[1] as OutputBundle for (const chunk of Object.values(bundle)) { if (chunk.type === 'chunk') {