我有tsconfig.json
文件:
{
"compilerOptions": {
"target": "ES6",
"lib": [
"DOM",
"ES6"
]
},
"include": [
"src/server/**/*"
],
"exclude": [
"node_modules",
"dist",
"public"
]
}
当我运行
tsc --project tsconfig.json
时,它完全忽略了include
和exclude
配置,并在node_modules
编译失败。唯一成功的方法是tsc src/server/**/*.ts
,但它没有使用配置文件。我验证了编译器处理配置文件,因为当我在"compilerOptions"
中添加"watch": true
时,它等待更改。我查看了documentation,但我不明白。它看起来像我已经将它放在了json文件的正确位置。有人有什么想法如何解决吗?
macOS Big Sur上的编译器版本:
% tsc -v
Version 4.0.5