"exclude" property of tsconfig.json is not being respected

Typescript will pull in any path that is referenced by an import statement in the files that are part of the project.

If you are seeing files getting processed that you have "excluded", then check for references to them in other code.


In a similar vein I was having issues with node_modules exclusion.

Here's a heavy handed solution, that ignores all *.d.ts files.

I added to compilerOptions:

"compilerOptions": {
    "skipLibCheck": true,
    ...
 }

Related:

  • https://www.typescriptlang.org/tsconfig#compilerOptions