我不明白tsconfig.json
中types
字段的含义。在文档中,我读到过这样的文本:
"types": {
"description": "Type declaration files to be included in compilation. Requires TypeScript version 2.0 or later.",
"type": "array",
"items": {
"type": "string"
}
},
据我所知,如果我安装了@types/express
,我应该在tsconfig.json
中添加这样的字符串
{
"compilerOptions": {
...
"types": ["lodash"]
}
}
但没有它,一切都很好。现在我不明白了,为什么我需要types
字段
https://stackoverflow.com/questions/39826848
复制相似问题