DEV Community

Discussion on: Does typescript increase the bundle size of a project?

Collapse
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦 • Edited

it depends on how it's used
optional chaining will have some effect,
if you don't use tslib, there could be significant duplication of code across a large project
also typescript prefers certain constructs like typeguard functions, which a javascript developer wouldn't necessarily have written

edit: that being said, typescript can do some work in types which javascript would have had to do at run time, so there could be some byte-savings there, if conscientiously applied