Skip to content

how to process tsconfig #1260

Answered by cspotcode
robbiemu asked this question in Q&A
Mar 1, 2021 · 1 comments · 7 replies
Discussion options

You must be logged in to vote

Try with --files. ts-node has an optimization to speed up typechecking where it only checks files referenced directly or indirectly by your entrypoint script. For example, if you run ts-node ./index.ts and index.ts imports foo.ts then it'll typecheck those 2 files. But if you have types from another file, bar.ts, then those won't be pulled in.

--files disables this optimization and makes ts-node match your tsconfig's files array.

Where if UUID declared? Is it a global type? Or do you need to import it?

Also, you should be able to use ts-node in worker threads like this:

NODE_OPTIONS='-r ts-node/register' TS_NODE_PROJECT=path/to/tsconfig.json node ./your-script.ts

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@cspotcode
Comment options

@cspotcode
Comment options

@robbiemu
Comment options

@robbiemu
Comment options

@cspotcode
Comment options

Answer selected by robbiemu
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