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
Styles bundle is not included when using Webpack 5 #6819
Comments
I think it relates to my issue as well - #6664 |
Can you try again with Nx 12.8.0? Also make sure to refer to the tailwind guide. https://nx.dev/latest/react/guides/using-tailwind-css-in-react#using-tailwind-css-in-react If it's because of #6558, I know what the issue is and it will be patched soon. |
@jaysoo I have tried with nx 12.8.0, still the same problem. I have pushed the updates to my repo at https://github.com/markogresak/nx-styles-bug#reproducing-the-problem-with-missing-styles-bundle. Tailwind is irrelevant here. To avoid any external factors, I have changed my reproduction repo to remove tailwind and use custom generated css. And yes, you're correct; the issue happens when there's > 50kB css. I've changed the generate script in my repo to generate smaller css and it did include it, but as soon as it hit 50kB mark, it was skipped. |
I have a fix ready for this. Going to see if we can cut a patch release for 12.8.0. We're also releasing 12.9.0 next week. In the meantime the only workaround is going back to webpack 4, or you can customize the webpack to remove the |
My workaround for now was to move the |
Great, sorry for the inconvenience. We'll get both the split chunks and minification fixed soon. |
No worries, no inconvenience caused, the workaround was simple. I’ve accepted the fact that webpack 5 support is still new and can have issues. I’m happy to test it out and provide feedback. |
+1 |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
The
styles
bundle is not included in thedist/.../index.html
when using Webpack 5. This happens if there is more than one file inbuild.styles
config ofworkspace.json
.Expected Behavior
All of the files listed in
build.styles
are bundled into a singlestyles.[hash].css
and included in thedist/.../index.html
file. It worked like this in webpack 4.Steps to Reproduce
I have created a project to reproduce the problem: https://github.com/markogresak/nx-styles-bug#reproducing-the-problem-with-missing-styles-bundle
It's a project where I've added only some randomly generated css to the output.
Failure Logs
grep css dist/apps/nx-styles-bug/index.html # <link rel="stylesheet" href="main.79da9420fe0c20301be7.css"></head>
It's missing the
591.f4af1e18666da591d76a.css
, which includes the stylesheets listed inworkspace.json
underbuild.styles
. Also, the missing file should be namedstyles.[hash].css
.Environment
The text was updated successfully, but these errors were encountered: