Using “preLaunchTasks” and Naming a Task in Visual Studio Code

前端 未结 6 1587
野的像风
野的像风 2021-01-31 14:32

According to the documentation, it is possible to launch a program before debugging:

To launch a task before the start of each debug session, set the

6条回答
  •  温柔的废话
    2021-01-31 15:05

    The question title is:

    "Using “preLaunchTasks” and Naming a Task in Visual Studio Code

    I needed to define preLaunchTask***s***.

    You can config multiple tasks using the dependsOn property described here

    For example, a compound task in your tasks.json:

    {
        "version": "2.0.0",
        "tasks": [
            {
                "label": "Client Build",
                "command": "gulp",
                "args": ["build"],
                "options": {
                    "cwd": "${workspaceRoot}/client"
                }
            },
            {
                "label": "Server Build",
                "command": "gulp",
                "args": ["build"],
                "options": {
                    "cwd": "${workspaceRoot}/server"
                }
            },
            {
                "label": "Build",
                "dependsOn": ["Client Build", "Server Build"]
            }
        ]
    }
    

    You can find more information about naming tasks here.

提交回复
热议问题