VSCode TypeScript问题Matcher`$ tsc-watch`未观看 [英] VSCode TypeScript problemMatcher `$tsc-watch` not watching
问题描述
我试图避免在tsconfig.json
配置中使用watch: true
.
I'm trying to avoid having to use watch: true
in a tsconfig.json
configuration.
通过VSCode的任务,我正在使用基本问题匹配器$tsc-watch
,但在构建时不会在监视模式下启动tsc
.我正在添加gulp
支持,我看到有gulp-watch
,但我想了解为什么$tsc-watch
不能按我认为的那样工作.
Through VSCode's tasks I'm using the base problem matcher $tsc-watch
but it's not launching tsc
in watch mode when building. 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.
推荐答案
我是通过查看typescript
扩展名的taskProvider.js
来解决这个问题的.为了使tsc-watch
起作用,需要设置option: "watch"
任务.
I figured this out by looking at the typescript
extension's taskProvider.js
. In order for tsc-watch
to function the task needed option: "watch"
to be set.
{
// 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
}
}
]
}
这篇关于VSCode TypeScript问题Matcher`$ tsc-watch`未观看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!