I'm using webpack-dev-server v1.14.1 for my project and the whole project structure is as follows:
|----src
| |----index.js
| |----components
| | |----a.js
| |----containers
| |----sub-containers
| |----b.js
|
|----package.json
|----webpack.config.dev.js
However, when I run command "webpack-dev-server --inline", the server can only catch changes in a.js file. It ignores changes in b.js file. Any thoughts?
Problem solved! It was caused by wrong import in src/index.js file. I imported b.js wrong way:
import B from "./containers/sub-containers/B";
I capitalized the file name "b". However, webpack didn't complain about this and could resolve this import. It only made hot reloading for changes in b.js not work. After changing it to:
import B from "./containers/sub-containers/b"
it works now! :)
NOTE: I'm still curious about why webpack can resolve the wrong filename. Or is it case insensitive?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With