Skip to content

Commit

Permalink
feat(core): add better detection of long running tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Aug 4, 2022
1 parent dc46534 commit 8bf9019
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/nx/src/tasks-runner/forked-process-task-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ export class ForkedProcessTaskRunner {
const env: NodeJS.ProcessEnv = {
NX_TASK_TARGET_PROJECT: task.target.project,
NX_TASK_HASH: task.hash,
// used when Nx is invoked via Lerna
LERNA_PACKAGE_NAME: task.target.project,
};

// TODO: remove this once we have a reasonable way to configure it
Expand Down
2 changes: 2 additions & 0 deletions packages/nx/src/tasks-runner/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ function longRunningTask(task: Task) {
const t = task.target.target;
return (
(!!task.overrides['watch'] && task.overrides['watch'] !== 'false') ||
t.endsWith(':watch') ||
t.endsWith('-watch') ||
t === 'serve' ||
t === 'dev' ||
t === 'start'
Expand Down

0 comments on commit 8bf9019

Please sign in to comment.