Skip to content

Commit e5202b7

Browse files
authored
fix: change router hmr not work (#109)
* fix: change router hmr not work * chore: remove console.log
1 parent 75cc377 commit e5202b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/core/src/context.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ export class PageContext {
105105
watcher.add(configs)
106106
}
107107
const targetDirs = [...this.options.dirs, ...this.options.subPackages].map(v => slash(path.resolve(this.root, v)))
108-
const isInTargetDirs = (path: string) => targetDirs.some(v => path.startsWith(v))
108+
const isInTargetDirs = (filePath: string) => targetDirs.some(v => slash(path.resolve(this.root, filePath)).startsWith(v))
109+
109110
watcher.on('add', async (path) => {
110111
path = slash(path)
112+
111113
if (!isTargetFile(path))
112114
return
113115

0 commit comments

Comments
 (0)