Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 822 Bytes

File metadata and controls

21 lines (15 loc) · 822 Bytes
title Performance

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.

  • Enable swc
    • This is by far the fastest option
  • Enable transpileOnly to skip typechecking without swc

With 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
  • Enable skipLibCheck
  • Set a types array to avoid loading unnecessary @types