TypeScript
Compile Commands
Compile TypeScript to JavaScript with tsc. Learn watch mode, incremental builds, and compilation targets for different environments from browsers to Node.js.
10 commands
Pro Tips
Use 'tsc --watch' for continuous compilation during development — only recompiles changed files.
Use 'tsc --noEmit' to type-check without generating JavaScript — perfect for CI validation.
Enable 'incremental: true' in tsconfig for faster subsequent builds using cached type information.
Common Mistakes
tsc doesn't bundle code. Use a bundler (Vite, esbuild, webpack) for production builds — tsc is for type-checking.
Changing 'target' affects which JavaScript features are downleveled. Ensure your target matches your runtime.