From 15fc850212005b761a7f286a5f4e9619778d0f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Wed, 11 Feb 2026 18:38:22 +0100 Subject: [PATCH] Remove redundant self-build from Nx targets that compile on the fly (#17851) ## Summary - Changed 6 Nx targets (`start`, `start:debug`, `typeorm`, `ts-node`, `database:migrate`, `database:migrate:revert`) from `dependsOn: ["build"]` to `dependsOn: ["^build"]` to eliminate a redundant full SWC compilation step (~30-60s per invocation). - These targets all use `nest start --watch`, `ts-node`, or TypeORM's CLI (which runs under ts-node), so they already compile TypeScript themselves. The `build` dependency was causing `rimraf dist && nest build` to run first, only for the target's own command to recompile everything again. - Fixed `start:debug` to call `nest start --watch --debug` directly instead of routing through `nx start --debug`, which would trigger yet another build cycle. Note: targets that run pre-compiled code from `dist/` (like `database:reset`) intentionally keep `dependsOn: ["build"]`. ## Test plan - [ ] Run `npx nx start twenty-server` and verify the server starts with only one SWC compilation pass instead of two - [ ] Run `npx nx start:debug twenty-server` and verify the debugger attaches correctly - [ ] Run `npx nx run twenty-server:database:migrate` and verify migrations run correctly - [ ] Run `npx nx run twenty-server:database:reset twenty-server` and verify it still builds before running (unchanged) Made with [Cursor](https://cursor.com) Co-authored-by: Cursor --- packages/twenty-server/project.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/twenty-server/project.json b/packages/twenty-server/project.json index 25159960a7..c26ea7eba1 100644 --- a/packages/twenty-server/project.json +++ b/packages/twenty-server/project.json @@ -47,7 +47,7 @@ "start": { "executor": "nx:run-commands", "cache": false, - "dependsOn": ["build"], + "dependsOn": ["^build"], "options": { "cwd": "packages/twenty-server", "command": "NODE_ENV=development nest start --watch" @@ -70,10 +70,10 @@ }, "start:debug": { "executor": "nx:run-commands", - "dependsOn": ["build"], + "dependsOn": ["^build"], "options": { "cwd": "packages/twenty-server", - "command": "nx start --debug" + "command": "NODE_ENV=development nest start --watch --debug" } }, "reset:env": { @@ -125,11 +125,11 @@ "cwd": "packages/twenty-server", "command": "ts-node --transpile-only -P tsconfig.json ../../node_modules/typeorm/cli.js" }, - "dependsOn": ["build"] + "dependsOn": ["^build"] }, "ts-node": { "executor": "nx:run-commands", - "dependsOn": ["build"], + "dependsOn": ["^build"], "options": { "cwd": "packages/twenty-server", "command": "ts-node" @@ -181,7 +181,7 @@ }, "database:migrate": { "executor": "nx:run-commands", - "dependsOn": ["build"], + "dependsOn": ["^build"], "options": { "cwd": "packages/twenty-server", "commands": [ @@ -198,7 +198,7 @@ }, "database:migrate:revert": { "executor": "nx:run-commands", - "dependsOn": ["build"], + "dependsOn": ["^build"], "options": { "cwd": "packages/twenty-server", "commands": [