Is there any downside to using ts-node in dev env but tsc in production? #1300
-
Since the way typescript compilation works in tsc is different from ts-node, what are the downsides or possible gotchas that may happen due to this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
No big gotchas. Generally the differences are in typechecking, which you can/should avoid by using
Lines 7 to 17 in 03355c1 These are pretty harmless changes. For example, enabling sourcemaps does not affect the emitted JS code other than appending a We intentionally avoid deviating from |
Beta Was this translation helpful? Give feedback.
No big gotchas. Generally the differences are in typechecking, which you can/should avoid by using
tsc
to typecheck and keepingts-node
fast with--transpile-only
. This is a personal recommendation; other people will disagree with me. Ultimately, the decision is yours to make. You can also avoid the major typechecking differences with--files
.ts-node
forces a few compiler options to be enabled, overriding your tsconfig.jsonts-node/src/configuration.ts
Lines 7 to 17 in 03355c1