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

[bug] CSS not updating with HMR #10

Closed
lnfnunes opened this issue Jan 21, 2019 · 5 comments
Closed

[bug] CSS not updating with HMR #10

lnfnunes opened this issue Jan 21, 2019 · 5 comments

Comments

@lnfnunes
Copy link
Contributor

Looks like HMR is not working for .css files!
I've changed file src/Components/Nav/Nav.css and the browser's console identified the change as you can see in the image:
image

But the change only get in place when I do a full reload on browser

@luangjokaj
Copy link
Owner

Hey @lnfnunes thank you for your feedback. It's actually still an open issue of the mini-css-extract-plugin package webpack-contrib/mini-css-extract-plugin#34

But you are right, this is very annoying. I switched the default client development configuration to use style-loader instead. This will allow the support of HMR for CSS. And it's not a deal breaker because mini-css-extract-plugin will work just fine in production.

I pushed this already ccfb736.
Let me know if this fixes your issue.

@lnfnunes
Copy link
Contributor Author

Thank you so much! Appreciate the fast-reply ;-)

@lnfnunes
Copy link
Contributor Author

@luangjokaj Just to know, why keep production different? Isn't better to change both and prevent future diferrences?

@luangjokaj
Copy link
Owner

Because we inject dynamically only what we use.
mini-css-extract-plugin
This plugin extracts CSS into separate files. It creates a CSS file per JS file which contains CSS. It supports On-Demand-Loading of CSS and SourceMaps.

@luangjokaj
Copy link
Owner

I switched to MiniCssExtractPlugin in development. This will fix the initial flashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants