Skip to content

Commit 22d9c23

Browse files
committed
Improve config file handling; nicepath debug info
Some files may be watched as both a config file and a build file (e.g. package.json), in which case their status as a config file should take precedence.
1 parent 4512b82 commit 22d9c23

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/application.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ export class Application extends AbstractComponent<
445445
/**
446446
* Register that the current build depends on a file, so that in watch mode
447447
* the build will be repeated. Has no effect if a watch build is not
448-
* running.
448+
* running, or if the file has already been registered.
449449
*
450450
* @param path The file to watch. It does not need to exist, and you should
451451
* in fact register files you look for, but which do not exist, so that if
@@ -550,9 +550,9 @@ export class Application extends AbstractComponent<
550550

551551
this._watchFile = (path: string, shouldRestart = false) => {
552552
this.logger.verbose(
553-
`Watching ${path}, shouldRestart=${shouldRestart}`,
553+
`Watching ${nicePath(path)}, shouldRestart=${shouldRestart}`,
554554
);
555-
this.watchers.get(path)?.close();
555+
if (!this.watchers.has(path)) return;
556556
this.watchers.set(
557557
path,
558558
host.watchFile(

0 commit comments

Comments
 (0)