Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set --verbose option in VSCode Typescript build task

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

like image 542
grim_i_am Avatar asked Feb 06 '19 17:02

grim_i_am


1 Answers

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"
            }
        }
    ]
}
like image 132
Spencer Pollock Avatar answered Oct 06 '22 21:10

Spencer Pollock