在使用npm定义时,tsc如何得到它的定义
所以我从使用typings
到使用npm
。 因此,您在@types
中有@types
目录,但除此之外,没有其他文件。
随着typings
我总是不得不包括index.d.ts
文件index.d.ts
,但使用npm
这是没有必要的。 我想问一下为什么是这样。
npm
是否使用了tsc
某种隐藏function,或者微软和npm
背后的人是否同意?
是的, ./node_modules/@types
自动检查./node_modules/@types
。 看看 :
默认情况下,所有可见的“@types”包都包含在您的编译中。 任何包含文件夹的node_modules / @types中的包都被视为可见; 具体来说,这意味着./node_modules/@types/,../node_modules/@types/,../../node_modules/@types/等内的包。