@babel/preset-typescript
lastmod 2025-02-11created 2022-04-076 edits
typescript preset for babel.
ts-loader vs @babel/preset-typescript
- typescript bundling
- babel loader & @babel preset typescript vs ts loader quick summary - woowa-techcamp-2021/store-4 Wiki
- 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
transplieOnlyoption. - 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
- babel
- typescript
- ts-loader - typescript loader for webpack.