Skip to content
Search

@babel/preset-typescript

lastmod 2025-02-11created 2022-04-076 edits

typescript preset for babel.

ts-loader vs @babel/preset-typescript

Using ts-loader
Pros: strong type checking
Cons: long build times. The build fails if there are type errors.
However, compile speed can be increased with the transplieOnly option.
HMR (hot module reloading) not available - https://github.com/TypeStrong/ts-loader#hot-module-replacement
Using babel-loader + @babel/preset-typescript
Pros - short build times, and you can use babel's many plugins.
Cons - weak type checking fails to take advantage of TypeScript's strengths.

See also

Favorite site

author Zer0 sitemap