Set --verbose option in VSCode Typescript build task
Asked Answered
C

1

8

When compiling from the command line I can specify

tsc -b --verbose

However I can't figure out how to configure the default build task in vs code to do the same. I can't find any related entry in tsconfig.json or in tasks.json

Cavalla answered 6/2, 2019 at 17:19 Comment(0)
L
8

From the VSCode tasks documentation to run a tsc build task, there is a TypeScript specific layout:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "type": "typescript",
            "tsconfig": "tsconfig.json",
            "problemMatcher": [
                "$tsc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

If you would like to run your own command arguments or shell commands, I recommend using the shell script, as it gives a bit more options and can be specific to what you'd like to run:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Run tsc verbosely",
            "type": "shell",
            "command": "tsc -b --verbose",
            "group": "test",
            "presentation": {
                "reveal": "always",
                "panel": "new"
            }
        }
    ]
}
Lenhart answered 11/3, 2019 at 14:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.