Closed HriBB closed 4 years ago
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 https://github.com/webpack-contrib/mini-css-extract-plugin/issues/151#issuecomment-414739879. 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 injectCss: true,
setting.
This in turn means, the JS refresh isn't broken with reload: false
.
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