mirror of
https://github.com/hanzoai/ts-node.git
synced 2026-10-30 19:36:25 +00:00
969 B
969 B
title
| title |
|---|
| Performance |
These tricks will make ts-node faster.
Skip typechecking
It is often better to typecheck as part of your tests or linting. You can run 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
- This is by far the fastest option
- Enable
transpileOnlyto skip typechecking without swc
With typechecking
If you absolutely must typecheck in ts-node:
- Avoid dynamic
require()which may trigger repeated typechecking; preferimport - Try with and without
--files; one may be faster depending on your project - Check
tsc --showConfig; make sure all executed files are included - Enable
skipLibCheck - Set a
typesarray to avoid loading unnecessary@types