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(css): skip style.css extraction if code-split css #18470

Merged
merged 1 commit into from
Oct 25, 2024
Merged

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Oct 25, 2024

Description

If we're code-splitting CSS, there's a portion of the code that was still extracting combined CSS chunks to emit the non-codesplit style.css chunk, which would always be empty.

The extraction was happening from

css += chunkCSSMap.get(chunk.preliminaryFileName) ?? ''

However the chunkCSSMap is only populated cssCodeSplit is disabled

} else {
// resolve public URL from CSS paths, we need to use absolute paths
chunkCSS = resolveAssetUrlsInCss(chunkCSS, cssBundleName)
// finalizeCss is called for the aggregated chunk in generateBundle
chunkCSSMap.set(chunk.fileName, chunkCSS)
}

This PR updates so that the extracting of combined CSS chunks only happens if cssCodeSplit is disabled.

@bluwy bluwy added feat: css p2-nice-to-have Not breaking anything but nice to have (priority) performance Performance related enhancement labels Oct 25, 2024
@patak-dev patak-dev merged commit 34fdb6b into main Oct 25, 2024
14 checks passed
@patak-dev patak-dev deleted the css-code-split branch October 25, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: css p2-nice-to-have Not breaking anything but nice to have (priority) performance Performance related enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants