Skip to content

Commit

Permalink
Update performance.md (#1837)
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Jul 13, 2022
1 parent 32d07e2 commit 3333005
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion website/docs/performance.md
Expand Up @@ -6,14 +6,18 @@ These tricks will make ts-node faster.

## Skip typechecking

It is often better to use `tsc --noEmit` to typecheck as part of your tests or linting. In these cases, ts-node can skip typechecking.
It is often better to typecheck as part of your tests or linting. You can use `tsc --noEmit` to do this. In these cases, ts-node can skip typechecking making it much faster.

To skip typechecking in ts-node, do one of the following:

* Enable [swc](./swc.md)
* This is by far the fastest option
* Enable [`transpileOnly`](./options.md#transpileonly) to skip typechecking without swc

## With typechecking

If you absolutely must use ts-node for typechecking:

* Avoid dynamic `require()` which may trigger repeated typechecking; prefer `import`
* Try with and without `--files`; one may be faster depending on your project
* Check `tsc --showConfig`; make sure all executed files are included
Expand Down

0 comments on commit 3333005

Please sign in to comment.