【问题标题】:VSCode TypeScript problemMatcher `$tsc-watch` not watchingVSCode TypeScript problemMatcher `$tsc-watch` 不看
【发布时间】:2018-08-19 23:16:43
【问题描述】:

我试图避免在 tsconfig.json 配置中使用 watch: true

通过 VSCode 的任务,我正在使用基本问题匹配器 $tsc-watch,但在构建时它没有在监视模式下启动 tsc。我正在添加gulp 支持,我看到有gulp-watch,但我想了解为什么$tsc-watch 不能正常工作。

【问题讨论】:

  • 你在用"schema": 2.0吗?
  • @AluanHaddad 我是。我只是通过查看 VS Code 打字稿扩展源才发现
  • 只是检查,因为前几天没有明确设置架构时遇到了一个奇怪的问题

标签: typescript visual-studio-code tsc vscode-tasks vscode-problem-matcher


【解决方案1】:

我通过查看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
            }
        }
    ]
}

【讨论】:

  • 有趣,这有记录吗?如果不是,请发送 PR
猜你喜欢
  • 2022-10-14
  • 1970-01-01
  • 2017-03-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多