Skip to content

Commit 3342d9f

Browse files
committed
fix #148 refresh after watching files
1 parent 570334c commit 3342d9f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/preview.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,8 @@ class FileWatchers {
169169
) {
170170
const watchers = new FileWatchers();
171171
const {files, imports} = parseResult;
172-
for (const name of new Set([
173-
...files.map((f) => join(dirname(path), f.name)),
174-
...imports.map((i) => join(dirname(path), i.name))
175-
])) {
176-
const watchPath = FileWatchers.getWatchPath(root, name);
172+
for (const name of new Set([...files.map((f) => f.name), ...imports.map((i) => i.name)])) {
173+
const watchPath = FileWatchers.getWatchPath(root, join(dirname(path), name));
177174
let prevState = await maybeStat(watchPath);
178175
let watcher;
179176
try {

0 commit comments

Comments
 (0)