Skip to content

Commit 1168d2a

Browse files
committed
Follow symlinks
Solves #231 and updates the README to match.
1 parent dc690bb commit 1168d2a

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ watchpack high level API doesn't map directly to watchers. Instead a three level
1919
- The real watchers are created by the `DirectoryWatcher`.
2020
- Files are never watched directly. This should keep the watcher count low.
2121
- Watching can be started in the past. This way watching can start after file reading.
22-
- Symlinks are not followed, instead the symlink is watched.
2322

2423
## API
2524

lib/DirectoryWatcher.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class DirectoryWatcher extends EventEmitter {
392392
const checkStats = () => {
393393
if (this.closed) return;
394394
this._activeEvents.set(filename, false);
395-
fs.lstat(filePath, (err, stats) => {
395+
fs.stat(filePath, (err, stats) => {
396396
if (this.closed) return;
397397
if (this._activeEvents.get(filename) === true) {
398398
process.nextTick(checkStats);
@@ -625,7 +625,7 @@ class DirectoryWatcher extends EventEmitter {
625625
}
626626
});
627627
for (const itemPath of itemPaths) {
628-
fs.lstat(itemPath, (err2, stats) => {
628+
fs.stat(itemPath, (err2, stats) => {
629629
if (this.closed) return;
630630
if (err2) {
631631
if (

0 commit comments

Comments
 (0)