Skip to content

The open alternative to Salesforce, designed for AI.

Fix twenty-front performances (#6744)

Charles Bochet1d6a1f64c93b
diff --git a/nx.json b/nx.json
index 4ec242fd517..35b6e750170 100644
--- a/nx.json
+++ b/nx.json
@@ -32,7 +32,7 @@
},
"start": {
"cache": true,
- "dependsOn": ["^typecheck","^build"]
+ "dependsOn": ["^build"]
},
"lint": {
"executor": "@nx/eslint:lint",
diff --git a/packages/twenty-front/.env.example b/packages/twenty-front/.env.example
index 423b00b0733..3fccb201c4b 100644
--- a/packages/twenty-front/.env.example
+++ b/packages/twenty-front/.env.example
@@ -3,3 +3,5 @@ GENERATE_SOURCEMAP=false
# ———————— Optional ————————
# CHROMATIC_PROJECT_TOKEN=
+# VITE_DISABLE_TYPESCRIPT_CHECKER=true
+# VITE_DISABLE_ESLINT_CHECKER=true
\ No newline at end of file
diff --git a/packages/twenty-front/package.json b/packages/twenty-front/package.json
index 0478db13abe..2fed3289213 100644
--- a/packages/twenty-front/package.json
+++ b/packages/twenty-front/package.json
@@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"build": "npx vite build && sh ./scripts/inject-runtime-env.sh",
- "build:sourcemaps": "VITE_BUILD_SOURCEMAP=true NODE_OPTIONS=--max-old-space-size=4096 npx nx build",
+ "build:sourcemaps": "VITE_BUILD_SOURCEMAP=true VITE_DISABLE_TYPESCRIPT_CHECKER=true VITE_DISABLE_ESLINT_CHECKER=true NODE_OPTIONS=--max-old-space-size=4096 npx nx build",
"start:prod": "NODE_ENV=production npx vite --host",
"tsup": "npx tsup"
},
diff --git a/packages/twenty-front/vite.config.ts b/packages/twenty-front/vite.config.ts
index 682b6466ab4..a9059b4d71f 100644
--- a/packages/twenty-front/vite.config.ts
+++ b/packages/twenty-front/vite.config.ts
@@ -15,7 +15,12 @@ export default defineConfig(({ command, mode }) => {
/*
Using explicit env variables, there is no need to expose all of them (security).
*/
- const { REACT_APP_SERVER_BASE_URL, VITE_BUILD_SOURCEMAP } = env;
+ const {
+ REACT_APP_SERVER_BASE_URL,
+ VITE_BUILD_SOURCEMAP,
+ VITE_DISABLE_TYPESCRIPT_CHECKER,
+ VITE_DISABLE_ESLINT_CHECKER,
+ } = env;
const isBuildCommand = command === 'build';
@@ -24,13 +29,16 @@ export default defineConfig(({ command, mode }) => {
: path.resolve(__dirname, './tsconfig.dev.json');
const checkers: Checkers = {
- typescript: {
- tsconfigPath: tsConfigPath,
- },
overlay: false,
};
- if (!isBuildCommand) {
+ if (VITE_DISABLE_TYPESCRIPT_CHECKER !== 'true') {
+ checkers['typescript'] = {
+ tsconfigPath: tsConfigPath,
+ };
+ }
+
+ if (VITE_DISABLE_ESLINT_CHECKER !== 'true') {
checkers['eslint'] = {
lintCommand:
'eslint . --report-unused-disable-directives --max-warnings 0 --config .eslintrc.cjs',
diff --git a/packages/twenty-server/project.json b/packages/twenty-server/project.json
index 2a993b848ec..a92e19caae2 100644
--- a/packages/twenty-server/project.json
+++ b/packages/twenty-server/project.json
@@ -22,7 +22,7 @@
},
"start": {
"executor": "nx:run-commands",
- "dependsOn": ["build"],
+ "dependsOn": ["typecheck", "build"],
"options": {
"cwd": "packages/twenty-server",
"command": "NODE_ENV=development && nest start --watch"