-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Extracted CSS is loaded all together #3943
Comments
Does it also happens if you add a |
@pimlie Good point! Will try 🤔 |
@pimlie Well, the styles don't interfere then anymore but CSS is still loaded (which was the "main point" here 🙈 ) |
I am actually having the same problem :/ Have anyone figured this out? |
@mauxtin The only workarounds are scoped styles or not extracting at the moment. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Not stale ⛔️ |
Do you have a solution for this issue? @manniL Btw, this is only happening when using |
@nmfzone This depends on https://github.com/webpack-contrib/mini-css-extract-plugin as #4219 |
Whoops, same problem? Ok, nice one. Let's see how it goes 👍 |
@Avcajaraville A workaround would be not using extractCSS for now :| |
@manniL and what would you recommend as an alternative? |
As I said above: Not extracting CSS. |
@nmfzone any particular reason you’d need to extract it? |
@manniL I would say probably caching issues is the biggest one. We dont wanna put all our modules/routes css in a style tag. Depending on the view it can be quite big. |
@Avcajaraville You can completely cache the component files which include the CSS. If you build it up modularly as well (moving component CSS into component files via |
I don't think I quite understand you. To be honest, I came across this issue from mini css, but not using nuxt. I found out I can have the css in js, but thats not satisfing for us, as we need CSS independent from JS (so JS is not needed to browse our site). The only solution so far, is to inject all the CSS into a style tag, which is impossible to cache, isn't? Is there anything Im missing ? Thanks a lot for your time and answers :) |
@Avcajaraville Oh, I see, wasn't aware of that :| In this case, you'll likely have to wait for a fix. |
same issue here |
1 similar comment
same issue here |
@manniL |
@jochouen can you share your code for that? It might affect perf but it could be a "workaround" |
before:
after:
|
my test, with vue 2.5.19 (2.5.18) released, this bug has been fixed already, @manniL |
@fe-shinemo Indeed. Updated the example and it's working now |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
v2.0.0
Reproduction link
https://codesandbox.io/s/github/manniL/nuxt-extract-css-include-bug/tree/master/
Steps to reproduce
npm i
npm run build && npm start
localhost:3000/
andlocalhost:3000/other
What is expected ?
localhost:3000/
-> Green background but no red colorlocalhost:3000/other
-> No Green background but no red colorWhat is actually happening?
The CSS of both pages is loaded together.
When using
scoped
styles, the CSS doesn't overlap but is still loaded (which harms perf if you have a lot of components/CSS).The text was updated successfully, but these errors were encountered: