Options for Compiling TypeScript
·
1 min read
·
114
Words
·
-Views
-Comments
I’ve seen projects using
tsc
,ts-loader
, orbabel-loader
for TypeScript builds. Here’s a short comparison so it’s clear what each does.
tsc
The official compiler. It performs type checking (unless you disable it—which defeats much of TypeScript’s value).
ts-loader
Webpack loader that delegates to tsc
under the hood. You can configure it to skip type checking for faster builds.
babel-loader
Babel is a general-purpose compiler; TypeScript support is just one plugin. It’s fast but doesn’t type-check, so pair it with tools like ForkTsCheckerWebpackPlugin if you need type safety.
Which Should You Use?
Within our team we use both ts-loader
and babel-loader
depending on the project. It largely comes down to preference and build requirements.