当前位置: 首页 > 工具软件 > BASH Debugger > 使用案例 >

vscode debugger简记

彭飞虎
2023-12-01

记录下vscode debuggger相关的配置便于查找

前端调试

文档

      {
        "name": "Attach to Chrome",
        "port": 9222,
        "request": "attach",
        "type": "chrome",
        "webRoot": "${workspaceFolder}/packages/xxx/",
      },
      {
        "name": "Launch Chrome",
        "request": "launch",
        "type": "chrome",
        // 入口地址
        "url": "http://localhost:4000",
        "webRoot": "${workspaceFolder}/packages/xxx/",
        "userDataDir": false,
        "runtimeExecutable": "/Applications/Google Chrome Beta.app/Contents/MacOS/Google Chrome Beta"
      },

attach模式化,需要命令行启动浏览器

使用beta调试,不和默认浏览器冲突,beta下载

/Applications/Google\ Chrome\ Beta.app/Contents/MacOS/Google\ Chrome\ Beta --remote-debugging-port=9222

nodejs调试

文档

nodejs attach

{
    // 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": "node",
        "request": "attach",
        "name": "Node: Nodemon",
        "processId": "${command:PickProcess}",
        "restart": true,
        "outFiles": [
          "!**/node_modules/**"
        ]
      }
    ]
}
 类似资料: