TypeScript版本: 2.2.3
码
$ tsc
// tsconfig.json
{
"compilerOptions": {
"declaration": true,
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"outDir": "dist",
"typeRoots": [
"./node_modules/@types/"
],
"exclude": [
"dist"
]
}
}
预期行为:
排除给定路径列表。
实际行为:
引发错误: error TS5023: Unknown compiler option 'exclude'
最后注
当使用选项include
或files
时,也会发生这种情况。 这些选项在最近更新的打字稿中是否贬值? 我找不到任何建议的文件...
实际上, files
, include
等是顶级字段
{
"compilerOptions": {},
"exclude": []
}
@ikatyang谢谢-不敢相信我ed
{
“ compilerOptions”:{
“声明”:是,
“ target”:“ es5”,
“ module”:“ commonjs”,
“ moduleResolution”:“节点”,
“ emitDecoratorMetadata”:是的,
“ experimentalDecorators”:是的,
“ removeComments”:否,
“ noImplicitAny”:否,
“ outDir”:“ dist”,
“ typeRoots”:[
“ ./node_modules/@types/”
]
},
“排除”:[
“ dist”
]
}
最有用的评论
实际上,
files
,include
等是顶级字段