Skip to content

Is there any downside to using ts-node in dev env but tsc in production? #1300

Answered by cspotcode
rohit-malhotra asked this question in Q&A
Discussion options

You must be logged in to vote

No big gotchas. Generally the differences are in typechecking, which you can/should avoid by using tsc to typecheck and keeping ts-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.json

/**
* TypeScript compiler option values required by `ts-node` which cannot be overridden.
*/
const TS_NODE_COMPILER_OPTIONS = {
sourceMap: true,
inlineSourceMap: false,
i…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cspotcode
Comment options

Answer selected by cspotcode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants