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

Comments

Projects
None yet
2 participants
@lnfnunes
Copy link

lnfnunes commented Jan 21, 2019

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

This comment has been minimized.

Copy link
Owner

luangjokaj commented Jan 21, 2019

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

This comment has been minimized.

Copy link
Author

lnfnunes commented Jan 21, 2019

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

@lnfnunes lnfnunes closed this Jan 21, 2019

@lnfnunes

This comment has been minimized.

Copy link
Author

lnfnunes commented Jan 21, 2019

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

@luangjokaj

This comment has been minimized.

Copy link
Owner

luangjokaj commented Jan 21, 2019

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

This comment has been minimized.

Copy link
Owner

luangjokaj commented Jan 22, 2019

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