Skip to content

Commit 23f823c

Browse files
matz3RandomByte
authored andcommitted
fix(project): Prevent exception when not building in watch mode
1 parent 9bad9ea commit 23f823c

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

packages/project/lib/build/ProjectBuilder.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,15 @@ class ProjectBuilder {
219219
});
220220
}
221221

222-
const [, watchHandler] = await Promise.all([
223-
this.#build(queue, projectBuildContexts, requestedProjects, fsTarget),
224-
pWatchInit
225-
]);
226-
watchHandler.setReady();
227-
return watchHandler;
222+
await this.#build(queue, projectBuildContexts, requestedProjects, fsTarget);
223+
224+
if (watch) {
225+
const watchHandler = await pWatchInit;
226+
watchHandler.setReady();
227+
return watchHandler;
228+
} else {
229+
return null;
230+
}
228231
}
229232

230233
async #build(queue, projectBuildContexts, requestedProjects, fsTarget) {

0 commit comments

Comments
 (0)