Skip to content

The open alternative to Salesforce, designed for AI.

[FIX] Nx project's scope build dependency management (#10010)

Paul Rastoin0a8d75bc072a
diff --git a/packages/twenty-chrome-extension/project.json b/packages/twenty-chrome-extension/project.json
index 5f0e8815ea8..eb42f1ef6be 100644
--- a/packages/twenty-chrome-extension/project.json
+++ b/packages/twenty-chrome-extension/project.json
@@ -8,7 +8,8 @@
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "{projectRoot}/dist"
- }
+ },
+ "dependsOn": ["^build"]
},
"start": {
"executor": "nx:run-commands",
diff --git a/packages/twenty-docker/twenty/Dockerfile b/packages/twenty-docker/twenty/Dockerfile
index 42d7064b27c..d17168392ba 100644
--- a/packages/twenty-docker/twenty/Dockerfile
+++ b/packages/twenty-docker/twenty/Dockerfile
@@ -26,9 +26,6 @@ COPY ./packages/twenty-emails /app/packages/twenty-emails
COPY ./packages/twenty-shared /app/packages/twenty-shared
COPY ./packages/twenty-server /app/packages/twenty-server
-RUN npx nx run twenty-shared:build
-RUN npx nx run twenty-emails:build
-
RUN npx nx run twenty-server:build
RUN mv /app/packages/twenty-server/dist /app/packages/twenty-server/build
RUN npx nx run twenty-server:build:packageJson
diff --git a/packages/twenty-emails/package.json b/packages/twenty-emails/package.json
index 8e52e476b5d..062bac2da74 100644
--- a/packages/twenty-emails/package.json
+++ b/packages/twenty-emails/package.json
@@ -9,6 +9,9 @@
"scripts": {
"build": "npx vite build"
},
+ "dependencies": {
+ "twenty-shared": "workspace:*"
+ },
"exports": {
".": {
"import": "./dist/index.mjs",
diff --git a/packages/twenty-emails/project.json b/packages/twenty-emails/project.json
index c5927d1bfa3..8442006c6d9 100644
--- a/packages/twenty-emails/project.json
+++ b/packages/twenty-emails/project.json
@@ -8,7 +8,8 @@
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "{projectRoot}/dist"
- }
+ },
+ "dependsOn": ["^build"]
},
"typecheck": {},
"lint": {
diff --git a/packages/twenty-server/project.json b/packages/twenty-server/project.json
index b873fa607a4..8f2f1b88814 100644
--- a/packages/twenty-server/project.json
+++ b/packages/twenty-server/project.json
@@ -10,7 +10,8 @@
"options": {
"cwd": "packages/twenty-server",
"commands": ["rimraf dist", "nest build --path ./tsconfig.build.json"]
- }
+ },
+ "dependsOn": ["^build"]
},
"test:integration": {
"executor": "nx:run-commands",