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

fix(react): fix extracCss option for webpack 5 #6925

Merged
merged 1 commit into from Sep 3, 2021

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Sep 3, 2021

This PR fixes a configuration issue with CSS extraction. There shouldn't be a split chunks configuration since we want to keep it all in one file.

Current Behavior

When using webpack 5 and the CSS gets too large it'll split into multiple chunks, and the generated index.html is missing styling.

Expected Behavior

Everything should work the same as before in webpack 4.

Related Issue(s)

Fixes #6819, #6664, #6558, #6816

@vercel
Copy link

vercel bot commented Sep 3, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/3M1iipM963fwxpB5irgSnwTD7Xtj
✅ Preview: Canceled

[Deployment for d3aaa6e canceled]


export class NamedLazyChunksPlugin {
constructor() {}
apply(compiler: Compiler): void {
// Webpack doesn't export these so the deep imports can potentially break.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to move it here since later versions of webpack 5 doesn't have these modules anymore, causing the build to break.

@FrozenPandaz FrozenPandaz merged commit 06d2035 into nrwl:master Sep 3, 2021
@jaysoo jaysoo deleted the fix-react-extract-css branch September 3, 2021 17:01
@markogresak
Copy link
Contributor

@jaysoo I have tested this change via the @next release (version 12.9.0-rc.0) and it does fix #6819, but not #6816 (css minification).

stylesOptimization is ignored with isWebpack5. I think we need the changes from #6817 or something similar.

ManojBahuguna pushed a commit to ManojBahuguna/nx that referenced this pull request Sep 16, 2021
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Styles bundle is not included when using Webpack 5
3 participants