feat(core): add better detection of long running tasks

This commit is contained in:
Victor Savkin 2022-08-04 13:20:29 -04:00
parent dc46534fe1
commit 8bf9019ec4
No known key found for this signature in database
GPG Key ID: 39178FEB7698B817
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -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'