From eefe8957167681b85f0e1b07bc5feefa307cccb0 Mon Sep 17 00:00:00 2001 From: Jonny Chen <31563977+Jonny-china@users.noreply.github.com> Date: Fri, 1 Nov 2024 13:57:48 +0800 Subject: [PATCH] fix(css): `cssCodeSplit` uses the current environment configuration (#18486) --- 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 ed6c01dabce60f..9677d3c2439d24 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -888,7 +888,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