In TypeSctipt 2.0, do you still need to include /// reference path="

时间:2016-07-11 20:24:56

标签: typescript

In TypeSctipt 2.0, do you still need to include /// reference path="" as in

///<reference path="../../../../typings/app.d.ts"/> or is that a thing of the past as now TS searches all directories specified in tsconfig? would great if someone can elaborate with detailed answer...

tx

Sean

1 个答案:

答案 0 :(得分:2)

您可以让tsconfig.json指定项目中的主要文件(因此称为包含文件。但是如果包含文件中有任何reference个标记指向不包含文件,它们也将包含在编译上下文中。

我一般不会使用reference条评论。

更多

此处还介绍了How does Typescript load typings? (and what each TS-related file's purpose is)