Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: legacy avoid insert the entry module css #9761

Merged
merged 2 commits into from Aug 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/vite/src/node/plugins/css.ts
Expand Up @@ -557,6 +557,14 @@ export function cssPostPlugin(config: ResolvedConfig): Plugin {
})
chunk.viteMetadata.importedCss.add(this.getFileName(fileHandle))
} 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
patak-dev marked this conversation as resolved.
Show resolved Hide resolved
if (chunk.isEntry) {
return null
}
chunkCSS = await finalizeCss(chunkCSS, true, config)
let cssString = JSON.stringify(chunkCSS)
cssString =
Expand Down