## Summary - Removed `vite-plugin-dts` (which used `tsc` internally) from the Vite build and replaced DTS generation with `tsgo` as a sequential post-build step — **~0.7s vs 1-10s**. - Disabled `reportCompressedSize` to skip gzip computation for 64 output files. - Converted the build target to an explicit `nx:run-commands` executor with sequential `vite build` → `tsgo` commands. The `twenty-emails:build` step goes from ~22s to ~7s under load. ## Test plan - [x] `nx build twenty-emails` produces both JS (64 files) and DTS (74 files) correctly - [x] `dist/index.d.ts` exports match the source `src/index.ts` - [x] Full `nx build twenty-server` succeeds end-to-end - [ ] CI build passes Made with [Cursor](https://cursor.com) --------- Co-authored-by: Cursor <cursoragent@cursor.com>
89 lines
2.4 KiB
JSON
89 lines
2.4 KiB
JSON
{
|
|
"name": "twenty-shared",
|
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
"sourceRoot": "packages/twenty-shared/src",
|
|
"projectType": "library",
|
|
"tags": [
|
|
"scope:shared"
|
|
],
|
|
"targets": {
|
|
"build": {
|
|
"executor": "nx:run-commands",
|
|
"cache": true,
|
|
"inputs": [
|
|
"production",
|
|
"^production"
|
|
],
|
|
"dependsOn": [
|
|
"generateBarrels",
|
|
"^build"
|
|
],
|
|
"outputs": [
|
|
"{projectRoot}/dist",
|
|
"{projectRoot}/ai/package.json",
|
|
"{projectRoot}/ai/dist",
|
|
"{projectRoot}/application/package.json",
|
|
"{projectRoot}/application/dist",
|
|
"{projectRoot}/constants/package.json",
|
|
"{projectRoot}/constants/dist",
|
|
"{projectRoot}/database-events/package.json",
|
|
"{projectRoot}/database-events/dist",
|
|
"{projectRoot}/metadata/package.json",
|
|
"{projectRoot}/metadata/dist",
|
|
"{projectRoot}/testing/package.json",
|
|
"{projectRoot}/testing/dist",
|
|
"{projectRoot}/translations/package.json",
|
|
"{projectRoot}/translations/dist",
|
|
"{projectRoot}/types/package.json",
|
|
"{projectRoot}/types/dist",
|
|
"{projectRoot}/utils/package.json",
|
|
"{projectRoot}/utils/dist",
|
|
"{projectRoot}/workflow/package.json",
|
|
"{projectRoot}/workflow/dist",
|
|
"{projectRoot}/workspace/package.json",
|
|
"{projectRoot}/workspace/dist"
|
|
],
|
|
"options": {
|
|
"cwd": "{projectRoot}",
|
|
"commands": [
|
|
"npx vite build",
|
|
"tsgo -p tsconfig.lib.json --declaration --emitDeclarationOnly --noEmit false --outDir dist --rootDir src && npx tsc-alias -p tsconfig.lib.json --outDir dist"
|
|
],
|
|
"parallel": false
|
|
}
|
|
},
|
|
"generateBarrels": {
|
|
"executor": "nx:run-commands",
|
|
"cache": true,
|
|
"inputs": [
|
|
"production",
|
|
"{projectRoot}/scripts/generateBarrels.ts"
|
|
],
|
|
"outputs": [
|
|
"{projectRoot}/src/index.ts",
|
|
"{projectRoot}/src/*/index.ts",
|
|
"{projectRoot}/package.json"
|
|
],
|
|
"options": {
|
|
"command": "tsx {projectRoot}/scripts/generateBarrels.ts"
|
|
}
|
|
},
|
|
"typecheck": {},
|
|
"test": {},
|
|
"lint": {
|
|
"options": {},
|
|
"configurations": {
|
|
"fix": {}
|
|
}
|
|
},
|
|
"fmt": {
|
|
"options": {
|
|
"files": "src"
|
|
},
|
|
"configurations": {
|
|
"fix": {}
|
|
}
|
|
}
|
|
}
|
|
}
|