diff --git a/packages/vite/src/node/plugins/css.ts b/packages/vite/src/node/plugins/css.ts index 1e1d08798911a5..4dc3aa7f158587 100644 --- a/packages/vite/src/node/plugins/css.ts +++ b/packages/vite/src/node/plugins/css.ts @@ -559,9 +559,9 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin { } else if (!config.build.ssr) { // legacy build and inline css - // simple build will collect all entry module css into chunk.viteMetadata.importedCss - // and inject into the `index.html` same with legacy - // legacy build should avoid insert the entry module css again + // the legacy build should avoid inserting entry CSS modules here, they + // will be collected into `chunk.viteMetadata.importedCss` and injected + // later by the `'vite:build-html'` plugin into the `index.html` if (chunk.isEntry) { return null }