In my webpack.config.js
I have 3 separate entry points, one for the JS bundle, one for the main SCSS bundle, and one for a separate SCSS bundle that has no relationship with the main SCSS bundle.
When I use the webpack.watch()
API, for some reason editing, say, the JS source files, causes not only the JS bundle to be recompiled, but also the 2 SCSS bundles.
Why is this, and how can I stop this behaviour and ensure that only the entry point that is edited is recompiled?
The reason this is an issue is I'm using browsersync
, and for CSS bundle recompiles I'm just injecting the CSS instead of reloading, but on HTML/JS edits its reloading. However if I edit the SCSS and it also recompiles the JS/HTML browsersync
triggers a reload instead of a CSS inject.