【发布时间】:2017-12-29 06:24:18
【问题描述】:
我正在运行这个任务:
{
"taskName": "tsc watch",
"command": "tsc -w",
"type": "shell",
"problemMatcher": "$tsc-watch"
}
使用这个 tsconfig:
{
"compileOnSave": true,
"files": [
"src/index.ts"
],
"compilerOptions": {
"module": "commonjs",
"sourceMap": true,
"outDir": "dist/"
},
"exclude": [
"node_modules"
]
}
文件index.ts只有一行:
console.log('Is it working?');
“问题”选项卡充满了来自随机 npm 模块的 HTML 相关警告。为什么?我该如何阻止它?
编辑1:
通过从资源管理器中排除 node_modules 文件夹,我设法找到了一个可行的方法:
/* settings.json */
{
"files.exclude": {
"**/node_modules": true
}
}
但是这是一个 hack,我仍然想要一个正确的答案..
【问题讨论】:
标签: typescript visual-studio-code tsconfig