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