Skip to content

Commit e3e8936

Browse files
sodclydin
authored andcommitted
fix(@angular/build): watchers outside the workspace via parcel didn't work
The `dirKey` entry in `this.pendingSubscriptions` caused the following `if` to never be true, as `this.isCoveredByExistingExternal(dirKey)` is always true as long as `dirKey` is in there. But at this point it isn't pending anymore, as we just `await`ed it the LoC prior. This bug caused the `else` to always run, which did `sub.unsubscribe()`, which killed the just spawned watcher. The effect was that a directory outside the workspace wasn't watched anymore. E.g. this structure: ``` apps/my-angular-app libs/my-angular-sdk node_modules/@my/sdk => symlink to libs/my-angular-sdk ``` When you ran `ng serve` in `apps/my-angular-app` (which has imports to `@my/sdk`) and made a change in `libs/my-angular-sdk`, then the watcher didn't rebuild (which it did before in 21.x). (cherry picked from commit 83eedfa)
1 parent 6a0c0a3 commit e3e8936

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎packages/angular/build/src/utils/watcher.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,8 @@ class ParcelExternalManager {
530530

531531
try {
532532
const sub = await subPromise;
533+
this.pendingSubscriptions.delete(dirKey);
534+
533535
if (this.externalDirFiles.has(dirKey) && !this.isCoveredByExistingExternal(dirKey)) {
534536
this.extraSubscriptions.set(dirKey, sub);
535537

0 commit comments

Comments
 (0)