Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
watchpack watch not triggering when symlinked node_module files are modified when using webpack 'symlinks: true' #61
In a regular webpack project, a symlinked module in node_modules is watched for changes correctly (as long as the module in question is referenced).
However, if using 'symlinks:true' in webpack to resolve symlinks to their full path (e.g. when using --preserve-symlinks behaviour in angular-cli), it does not seem to watch for changes anymore.
I have tracked this behaviour down to the 'followSymlinks' option of DirectoryWatcher in watchpack (https://github.com/webpack/watchpack/blob/master/lib/DirectoryWatcher.js). The followSymlinks option is always set to false which causes an issue with file watching when webpack is set to resolve symlinks. If it is manually set to true in this scenario, the watching works. Ideally this option would be configurable.