Tasks, Build Systems & npm Scripts
VS Code's task system lets you run build commands, test runners, and scripts directly from the editor — with output streamed to a dedicated terminal and problem matchers that link errors back to source files.
1What Are Tasks?
Tasks are configured commands that VS Code can run on your behalf. They can be triggered by a shortcut (Ctrl+Shift+B for the default build task), from the Command Palette (Run Task), or automatically on folder open.
2Auto-Detecting npm Scripts
VS Code reads your package.json and auto-detects all scripts as runnable tasks. Open Terminal › Run Task to see the full list. Right-click a script in the NPM Scripts sidebar to set one as the default build task.
3Creating tasks.json
{ "version": "2.0.0", "tasks": [{ "label": "Build TypeScript", "type": "shell", "command": "tsc", "group": { "kind": "build", "isDefault": true }, "problemMatcher": "$tsc" }] }
4Problem Matchers
Problem matchers parse task output and turn errors/warnings into clickable items in the Problems panel. VS Code ships with matchers for $tsc, $eslint, $go, $gcc, and many more.
5Compound Tasks & Depends On
Chain tasks together with dependsOn — for example, run Clean then Build then Test as a single CI task. Use "dependsOrder": "sequence" to run them one after another.