Webpack isn’t “watching” on Windows (Working on Mac) resolving modules

I have a project in which I require other files as modules (as indicated here as “resolving a module path”: http://webpack.github.io/docs/resolving.html).

I have a directory structure like that:
app.js
scripts/components/Nav.js

So I have that in my app.js file:

var Nav = require('components/Nav');

In the webpack.config.js file I specify how to resolve modules using the resolve.root property:

resolve: {root: [__dirname + '/scripts']}

Now the problem is that Webpack doesn’t “watch” the required files in Windows.
It means that Webpack isn’t rebuilding the bundle automatically if I change the scripts/components/Nav.js file.
But it recompiles it if I require using a relative path:

var Nav = require('./components/Nav');

This problem is present only in Windows: it works like a charm on Mac (didn’t try on Unix though).

Author: Fantashit

1 thought on “Webpack isn’t “watching” on Windows (Working on Mac) resolving modules

Comments are closed.