How description files are loaded in typescript

in the past, typescript d.ts files were only loaded when needed with the ///<reference path="... instruction. However, I understand that this has recently changed, and now the compiler can automatically load some local definition files I tried to find the rules for this by doing a Google search and looking at the TS specifications, but without success at the moment.

Would anyone be kind enough to explain these rules or point me in the right direction?

+5
source share
1 answer

These days everyone uses tsconfig.json , the original or atom- (in the Atom editor).

When using tsconfig.json you can omit the list of files, and the typescript compiler will compile all *.ts files that it finds in any subdirectory, including *.d.ts .

Exclude files through exclude on the path , as well as globbing files .

If you do not want to use tsconfig.json or need to transcode the files right now, you can achieve similar behavior using gulp with gulp-typescript and gulp-filter .

+4
source

All Articles