* Returns the path to watch, relative to the current working directory, for * the specified source path, relative to the source root.
(path: string)
| 243 | * the specified source path, relative to the source root. |
| 244 | */ |
| 245 | getWatchPath(path: string): string | undefined { |
| 246 | const exactPath = join(this.root, path); |
| 247 | if (existsSync(exactPath)) return exactPath; |
| 248 | if (exactPath.endsWith(".js")) { |
| 249 | const module = findModule(this.root, path); |
| 250 | return module && join(this.root, module.path); |
| 251 | } |
| 252 | const foundPath = this.find(path)?.path; |
| 253 | if (foundPath) return join(this.root, foundPath); |
| 254 | } |
| 255 | |
| 256 | watchFiles(path: string, watchPaths: Iterable<string>, callback: (name: string) => void) { |
| 257 | return FileWatchers.of(this, path, watchPaths, callback); |
no test coverage detected