Project References
json
// tsconfig.json
{
"compilerOptions": {
"composite": true,
"declaration": true,
"declarationMap": true
},
"references": [
{ "path": "../core" },
{ "path": "../utils" }
]
}Incremental Builds
json
{
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": ".tsbuildinfo"
}
}Watch Mode
bash
# Use watch mode for faster development
tsc --watch
# With project references
tsc --build --watchType-Only Imports
typescript
// Type-only import - not emitted in JS
import type { User } from './types';
import { userService } from './services';
// Type-only export
export type { User };Skip Lib Check
json
{
"compilerOptions": {
"skipLibCheck": true
}
}Conclusion
Optimize your TypeScript setup for faster compilation and better developer experience.