The format changed. Visual Studio Code can create the tasks.json
file for you. Inside your launch.json
file and inside any configurations object, just define preLaunchTask
to force auto-creation of the tasks.json
template file:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "launch program",
"skipFiles": [ "<node_internals>/**"],
"preLaunchTask": "myShellCommand",
"program": "${workspaceFolder}/test.js"
}
]
}
If you do not have file tasks.json
configured:
- launch the debugger. Visual Studio Code will inform you: "could not find the task
myShellCommand"
- select Configure Task → Create tasks.json file
from template → Others
Your tasks.json
template file will then be created for you. Add your command to command
and the name you put in preLaunchTask
to label
:
{
"version": "2.0.0",
"tasks": [
{
"label": "myShellCommand",
"type": "shell",
"command": "echo goodfood"
}
]
}