Skip to content

Commit d78c4be

Browse files
committed
fix(watchers): only watch client and controller if needed
1 parent 6abee4e commit d78c4be

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/watch/watchers.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export class BaseWatch implements Roots, Watch {
7979
/.*\.log$/,
8080
/tsconfig\.json/,
8181
/jsconfig\.json/,
82-
/\/test\//
82+
/\/test\//,
83+
/__test__/
8384
]),
8485
persistent: true
8586
});
@@ -239,7 +240,7 @@ export class PieWatch {
239240
configure: PieConfigure) {
240241
logger.debug('[PieWatch] constructor: ', name, relativePath, pieItemDir, installDirs);
241242
const pkgDir = resolve(join(pieItemDir, relativePath));
242-
const rootIgnores = [/.*controller.*/, /.*configure.*/]
243+
const rootIgnores = [/.*controller.*/, /.*configure.*/];
243244

244245
if (element.isRootPkg) {
245246
this.client = new PackageWatch(name, pkgDir, installDirs.root, rootIgnores);
@@ -258,8 +259,12 @@ export class PieWatch {
258259
}
259260

260261
public start() {
261-
this.client.start();
262-
this.controller.start();
262+
if (this.client) {
263+
this.client.start();
264+
}
265+
if (this.controller) {
266+
this.controller.start();
267+
}
263268
if (this.configure) {
264269
this.configure.start();
265270
}

0 commit comments

Comments
 (0)