-
Notifications
You must be signed in to change notification settings - Fork 42
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
CSS hot reload does not work with Webpack 4 and mini-css-extract-plugin #69
Comments
I have the same problem (setup is mostly the same). Anyone found out any solutions? |
Hey @paulmasek ... I'm not sure the JS file output in mini-css-extract-plugin is related to this issue above. For sure if you have BrowserSync watching for JS file updates then that will cause the browser refresh, but by default BrowserSync doesn't watch for JS file. And so the main issue is right now any SCSS/CSS file changes and BrowserSync does a full browser refresh (jumps to the top in Firefox) instead of injecting the CSS. |
@onetrev I started a new webpack config today and I was able to get this working. Thanks to @fqborges comment and package here webpack-contrib/mini-css-extract-plugin#151 (comment). This (magically) deletes the JS file outputted, meaning that BrowserSync doesn't try and reload the browser when it spots a JS change, and injects the CSS instead, as per the This in turn means, the JS refresh isn't broken with |
please, refer to the above comment. thanks everyone. |
When I save a .scss file it always reloads the page. I'm not really sure if this is a "problem" with this plugin or webpack or mini-css-extract-plugin.
Here's my webpack config
Problem is that both .js and .css files are built
And my package.json
The text was updated successfully, but these errors were encountered: