microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.14k stars 12.51k forks source link

How to find/debug what file(s) included given file during typescript compilation #32291

Open Akxe opened 5 years ago

Akxe commented 5 years ago

Search Terms

find why was file included during typescript build

Suggestion

Be able to find out why a file was checked by TS compiler during a build.

Use Cases

Sometimes testing files gets somehow mixed into the type checking for dev/prod builds.

Examples

If a flag explain-inclusion=FLFolder.mock.ts is present:

projects/folder-listing/src/app/services/FLEntities/FLFolder.mock.ts was included, because it was requested by:

Checklist

My suggestion meets these guidelines:

orta commented 5 years ago

Have you seen the module tracing options? I think that might do what you're looking for

RyanCavanaugh commented 5 years ago

We need something like this, but for file inclusion more broadly, not just module resolution. This would probably help clear up some confusion around includes / excludes / typeRoots / types

Akxe commented 5 years ago

Well the request is actually because of misunderstanding of inclusion versus exclusion... https://stackoverflow.com/questions/56886718/how-to-find-debug-what-file-include-other-file-in-typescript-compilation