From ee2425661157c4d90e2d766beca49b53c3022554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=A0=20/=20green?= Date: Mon, 9 Dec 2024 14:29:00 +0900 Subject: [PATCH] fix: define should be included in hash calc when keepProcessEnv is false --- packages/vite/src/node/optimizer/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/optimizer/index.ts b/packages/vite/src/node/optimizer/index.ts index df54a0c9ae98ed..1e528190f85b7d 100644 --- a/packages/vite/src/node/optimizer/index.ts +++ b/packages/vite/src/node/optimizer/index.ts @@ -1212,7 +1212,7 @@ function getConfigHash(environment: Environment): string { const { optimizeDeps } = config const content = JSON.stringify( { - define: config.keepProcessEnv + define: !config.keepProcessEnv ? process.env.NODE_ENV || config.mode : null, root: config.root,