fix: prevent splitChunks from emptying app.css in dev mode#241
Closed
arbrandes wants to merge 1 commit intoopenedx:mainfrom
Closed
fix: prevent splitChunks from emptying app.css in dev mode#241arbrandes wants to merge 1 commit intoopenedx:mainfrom
arbrandes wants to merge 1 commit intoopenedx:mainfrom
Conversation
Adds a cacheGroups entry that consolidates all extracted CSS back into app.css, so HtmlWebpackPlugin's injected link tag resolves correctly. Without it, splitChunks moves the CSS to a numbered chunk, leaving app.css empty and causing a 404 on every dev server reload. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
|
False alarm. This is not really necessary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When
shell/style.tswas introduced in the CSS cascade layers commit, Paragon, shell, and brand CSS started being processed throughMiniCssExtractPluginas separate module imports rather than inlined via SCSS@use. This gives HtmlWebpackPlugin a CSS asset to link for theappentry - butsplitChunks: { chunks: 'all' }moves the content to a numbered chunk, leavingapp.cssempty. HtmlWebpackPlugin injects the<link href="/app.css">tag regardless, resulting in a 404 on every dev server reload.The fix adds a
cacheGroupsentry that consolidates all extracted CSS back intoapp.css, preventing the split. JS chunking is unaffected. The production build config is unchanged.LLM usage notice
Built with assistance from Claude.