Tips on how to debug tsc builds.
Setting up or modifying Typescript builds can be finicky. Here’s a collection of Typescript compiler (
tsc) commands that are useful for debugging.
Print the compiler configuration and exit.
- Debugging nested or extended
tsconfigs, or check if CLI arguments are overriding
Lists the files that are processed as part of the build.
--listFilesOnlywill list files and exit, if that’s all that’s needed.
- Figuring out if your
excludesettings are working as expected.
List the paths of all files generated from the build.
- Check output file locations.
- Check that expected files are being generated.
See what paths are considered when finding modules (module resolution) and which module ends up being picked.
- Determining which paths are checked during module resolution when unable to find modules.
- See if the correct module is picked up with nested packages, custom package locations, etc.
Breakdown of size project (files, lines of code, number of types, …) and compiler performance per compilation stage.
NOTE: This is a subset and user friendly version of
- Debug compiler performance.
- See how big and cool your project is.