我正在努力避免在tsconfig.json配置中使用watch: true。
通过VSCode的任务,我使用了基本问题匹配器$tsc-watch,但它在构建时不会在监视模式下启动tsc。我正在添加gulp支持,我看到有gulp-watch,但我想知道为什么$tsc-watch不能像我认为的那样工作。
发布于 2018-03-12 13:50:26
我通过查看typescript扩展的taskProvider.js发现了这一点。为了让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
}
}
]
}https://stackoverflow.com/questions/49226705
复制相似问题