2

How do I set a directory as excluded from TypeScript compilation in WebStorm?

The IDE's TypeScript compilation service doesn't seem to be respecting the tsconfig.json's exclude setting for compilation. Running tsc from the terminal properly ignores the needed folder, but WebStorm (and for that matter all JetBrains IDEs) completely ignore it and compile everything in the root directory.

I have set -p ./tsconfig.json as an option in Settings > Languages & Frameworks > Typescript and yet the excluded directory still gets compiled.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Emberfire
  • 89
  • 7
  • Hey, have you checked this? https://stackoverflow.com/questions/34224972/webstorm-ignoring-excluded-directories-in-a-tsconfig-json-file Might be related to paths diff... – sleepwalker Feb 18 '23 at 22:23

1 Answers1

0

I had the same issue. We use monorepo and recently migrated to project references. There was a base tsconfig.json in the project root, all the other project used typescript project references and extended the base tsconfig.json accordingly. When compiled any project with tsc -b everything was ok. But WebStorm picked up the root tsconfig.json where exclude was empty, so tried to compile everything. Maybe it is the same for your setup, worth a check.

Istvan Tabanyi
  • 743
  • 5
  • 12