![](/img/trans.png)
[英]Typescript compilation using tsc-watch - File dist/server.js has unsupported extension
[英]VSCode TypeScript problemMatcher `$tsc-watch` not watching
我试图避免在tsconfig.json
配置中使用watch: true
。
通过 VSCode 的任务,我正在使用基本问题匹配器$tsc-watch
,但它在构建时不会以监视模式启动tsc
。 我正在添加gulp
支持,我看到有gulp-watch
,但我想了解为什么$tsc-watch
没有像我认为的那样工作。
我通过查看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
}
}
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.