Skip to content

Commit cad12f3

Browse files
committed
Update with absolute path
1 parent 87872e5 commit cad12f3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/watcher.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import path from "path"
12
import chokidar, { FSWatcher } from "chokidar";
23

34
export function startFileWatcher(watchPaths: string[], callback: Function): FSWatcher {
@@ -9,8 +10,9 @@ export function startFileWatcher(watchPaths: string[], callback: Function): FSWa
910
}
1011
});
1112

12-
watcher.on('all', (event, path) => {
13-
callback();
13+
watcher.on('all', (event, relativePath) => {
14+
const absolutePath = path.resolve(relativePath)
15+
callback(event, absolutePath);
1416
});
1517
return watcher;
1618
}

0 commit comments

Comments
 (0)