-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
extract_css does't work well with chunking #2268
Comments
Looks like this will be fixed with Webpack@5. |
The issue where you can't create Do you happen to know the release date for Webpack 5? I couldn't find it. |
When these are done: https://github.com/webpack/webpack/projects/5
This is what lazy() is meant to do, if you import your styles in a pack file, you won't see this behavior. Perhaps I misunderstand your requirements? |
Here's what I mean:
It would be nice to have an additional configuration option, maybe Why do I think this additional feature is a good idea? Because the way |
This is the intended goal of
This is a good case in favor of an |
I understand that. However, a common use case (and, I think, the primary use case for Considering that this common use-case can be covered by two lines of webpack config, it would be nice to integrate the feature into |
Is this still an issue? Feel free to reopen if needed |
If you use automatic late-loaded chunking (for example, through React's
lazy()
function), and turn onextract_css
, you get one CSS file per chunk, which is probably not the desired behavior when there are many small chunks. I can fix it like this:however, it creates
styles.css
, notapplication.css
(or whatever matches my entrypoint). It would be useful to have an option to create one chunk per entrypoint, or just one big chunk which would be loaded as a side-effect ofstylesheet_pack_tag
.Doing this also has a side-effect of creating
styles.js
, which, annoyingly, must be loaded, or no JS chunks will be evaluated. Related: webpack-contrib/mini-css-extract-plugin#147The text was updated successfully, but these errors were encountered: