Halo
发布于 2022-10-11 / 169 阅读 / 0 评论 / 0 点赞

vscode调试vite项目

launch.json

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "dev",
      "url": "http://localhost:8848",
      "webRoot": "${workspaceFolder}/src",
      "preLaunchTask": "nodejs",
      "postDebugTask": "endjs"
    }
  ]
}

task.json

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "nodejs",
      "type": "shell",
      "command": "pnpm run dev",
      "problemMatcher": "$vite",
      "isBackground": true
    },
    {
      "label": "endjs",
      "command": "echo ${input:terminate}",
      "type": "shell",
      "problemMatcher": []
    }
  ],
  "inputs": [
    {
      "id": "terminate",
      "type": "command",
      "command": "workbench.action.tasks.terminate",
      "args": "terminateAll"
    }
  ]
}

评论