1

Starting with a basic create-react-app, npx create-react-app my-app --template typescript, running tsc --listFiles will list some files. Then installing npm install @types/lodash-es for example, and then running tsc --listFiles will list every single type for lodash-es as well, even if theres not a single import for it.

Is there anything to prevent that? It seems to increase the compile time as well. For some larger projects, tsc basically just doesn't work for me anymore, just hanging.

Haobo Zhang
  • 141
  • 5
  • does it help you? [how to force tsc to ignore node modules](https://stackoverflow.com/questions/51634361/how-to-force-tsc-to-ignore-node-modules-folder) – Yago Biermann Apr 20 '22 at 19:47
  • `@types` are automatically included by default. – unional Apr 20 '22 at 19:50
  • It looks like adding "types":[] does remove those files and reduces compile time, but for my larger projects, which have stuff like mui, tsc never finishes and crashes after an extremely long time. Is there any way to exclude everything from node_modules, or at least tell me if something is happening, its just hanging on tsc. – Haobo Zhang Apr 20 '22 at 20:31

0 Answers0