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

前端 未结 6 1693
野的像风
野的像风 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:01

    FWIW, I'm using VS Code 1.20.1 and here's how I got my preLaunchTask to work:

    In launch.json:

    {
      "version": "0.2.0",
      "configurations": [
        {
            "type": "node",
            "request": "launch",
            ...
            "preLaunchTask": "npm: build",
        }
      ]
    }
    

    In my package.json:

    {
      ...
      "scripts": {
         "build": "tsc"
         ...
      }
    }
    

提交回复
热议问题