[英]VSCode TypeScript problemMatcher `$tsc-watch` not watching
I'm trying to avoid having to use watch: true
in a tsconfig.json
configuration.我试图避免在
tsconfig.json
配置中使用watch: true
。
Through VSCode's tasks I'm using the base problem matcher $tsc-watch
but it's not launching tsc
in watch mode when building.通过 VSCode 的任务,我正在使用基本问题匹配器
$tsc-watch
,但它在构建时不会以监视模式启动tsc
。 I'm adding gulp
support and I see there is gulp-watch
but I'd like to understand why $tsc-watch
isn't working as I believe it should.我正在添加
gulp
支持,我看到有gulp-watch
,但我想了解为什么$tsc-watch
没有像我认为的那样工作。
I figured this out by looking at the typescript
extension's taskProvider.js
.我通过查看
typescript
扩展的taskProvider.js
弄清楚了这一点。 In order for tsc-watch
to function the task needed option: "watch"
to be set.为了让
tsc-watch
运行任务所需的option: "watch"
。
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "typescript",
"tsconfig": "tsconfig.json",
"isBackground": true,
"problemMatcher": ["$tsc-watch"],
"option": "watch",
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.