TSConfig
explainFiles
Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation.
For example, with this project of just a single index.ts
file
sh
example├── index.ts├── package.json└── tsconfig.json
Using a tsconfig.json
which has explainFiles
set to true:
json
{"compilerOptions": {"target": "es5","module": "commonjs","explainFiles": true}}
Running TypeScript against this folder would have output like this:
❯ tscnode_modules/typescript/lib/lib.d.tsDefault library for target 'es5'node_modules/typescript/lib/lib.es5.d.tsLibrary referenced via 'es5' from file 'node_modules/typescript/lib/lib.d.ts'node_modules/typescript/lib/lib.dom.d.tsLibrary referenced via 'dom' from file 'node_modules/typescript/lib/lib.d.ts'node_modules/typescript/lib/lib.webworker.importscripts.d.tsLibrary referenced via 'webworker.importscripts' fromfile 'node_modules/typescript/lib/lib.d.ts'node_modules/typescript/lib/lib.scripthost.d.tsLibrary referenced via 'scripthost'from file 'node_modules/typescript/lib/lib.d.ts'index.tsMatched by include pattern '**/*' in 'tsconfig.json'
The output above show:
- The initial lib.d.ts lookup based on
target
, and the chain of.d.ts
files which are referenced - The
index.ts
file located via the default pattern ofinclude
This option is intended for debugging how a file has become a part of your compile.