tsc vs Babel: Which to Compile TypeScript in CI?
tsc both type-checks and emits JavaScript; Babel only strips types and transpiles fast - so many pipelines use both, for different jobs.
tsc is the TypeScript compiler: it type-checks and can emit JavaScript. Babel (with the TypeScript preset) strips types and transpiles quickly but does not type-check. They solve overlapping but distinct problems.
| tsc | Babel | |
|---|---|---|
| Type checking | Yes | No (strips types only) |
| Emit speed | Slower | Fast |
| Cross-file type info | Yes | No (per-file transform) |
| Plugins / transforms | Limited | Large plugin ecosystem |
| Typical CI role | Type-check (--noEmit) | Fast transpile in bundler |
In CI
A common, fast pattern is to let a fast transpiler (Babel, esbuild, or SWC) emit JavaScript while running tsc --noEmit purely for type-checking. tsc alone is the safest single tool because it both checks and emits, but it is slower. Babel alone is fast but cannot catch type errors - so a separate tsc --noEmit step is essential if you rely on Babel for emit.
Speed it up
Run the type-check (tsc --noEmit) and the build in parallel jobs, and cache dependencies and the TS build info. Both run on CI runners; faster managed runners shorten long type-check passes on big codebases.
The verdict
Want one tool that checks and emits: tsc. Want fast transpile and rich transforms: Babel - but add a tsc --noEmit type-check step. Most pipelines pair a fast transpiler with tsc for checking.