简体   繁体   English

VSCode TypeScript problemMatcher `$tsc-watch` 不看

[英]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.

相关问题 Typescript 使用 tsc-watch 编译 - 文件 dist/server.js 具有不受支持的扩展名 - Typescript compilation using tsc-watch - File dist/server.js has unsupported extension VSCode TypeScript问题Matcher不起作用 - VSCode TypeScript problemMatcher not working tsc-watch 消耗 TSC_NONPOLLING_WATCHER 吗? - Does tsc-watch consume TSC_NONPOLLING_WATCHER? Webpack监视模式下Typescript的problemMatcher - problemMatcher for Typescript in Webpack watch mode Typescript tsc -w命令不监视文件更改 - Typescript tsc -w command not watching for file changes tsc-watch 抛出错误:“文件 'dist/index.js' 是 JavaScript 文件。 您的意思是启用“allowJs”选项吗?” - tsc-watch throwing error: “File 'dist/index.js' is a JavaScript file. Did you mean to enable 'allowJs' option?” tsc 命令和 tsconfig watch 之间的区别:Typescript 中的 true? - Difference between tsc command, and tsconfig watch:true in Typescript? TypeScript tsc:如何同时观看多个项目? - TypeScript tsc: How to watch multiple projects at the same time? Intellisense在VSCode打字稿监视窗口中不起作用 - Intellisense not working in VSCode typescript watch window 有没有办法通过单击 VSCode 上的按钮/快捷方式同时运行“tsc -watch”和“npm start”? - Is there a way to run “tsc -watch” and “npm start” at the same time, with a click of a button/ shortcut on VSCode?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM