I'm currently working on converting a subproject to TypeScript within my monorepo. Within my npm scripts, I initially had:
"build-proj1":"tsc --build ./proj1/tsconfig.json"
Although it did work, I noticed that the process was unusually slow.
After making a simple adjustment to:
"build-proj1":"tsc --project ./proj1/tsconfig.json"
The execution speed significantly improved while producing the same outcome...
Below is my tsconfig.json
for reference:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"module": "CommonJS",
"target": "es2018",
"lib": ["es2019"],
"noImplicitAny": false,
"declaration": false,
"allowJs": true,
"preserveConstEnums": true,
"outDir": "./dist",
"sourceMap": true,
"skipLibCheck": true,
"baseUrl": "./",
"types": ["node"],
"typeRoots": ["../node_modules/@types"],
"strict": true,
"esModuleInterop": true,
"disableReferencedProjectLoad": true,
"paths": {
"root-common/*": ["../common/*"],
"root-config/*": ["../config/*"],
"root/*": ["../*"]
}
},
"include": ["./**/*"],
"exclude": ["node_modules", "**/*.spec.ts", "**/*.test.*", "./dist/**/*", "../common/**/*test.*"]
}
My inquiry pertains to understanding the distinction between using --build
and --project
, as well as why --build
runs considerably slower than --project
?