From 654cd3e163992e04a8b248f9b518162bbf5f085b Mon Sep 17 00:00:00 2001 From: Jonny-china Date: Mon, 28 Oct 2024 10:05:17 +0800 Subject: [PATCH] fix(css): `cssCodeSplit` uses the current environment configuration instead of the top level --- packages/vite/src/node/plugins/css.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index c371a867b88dd8..b51b81db833aca 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -868,7 +868,7 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin { } // extract as single css bundle if no codesplit - if (!config.build.cssCodeSplit && !hasEmitted) { + if (!this.environment.config.build.cssCodeSplit && !hasEmitted) { let extractedCss = '' const collected = new Set() // will be populated in order they are used by entry points