VsCode——chrome调试launch.json配置文件

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [

        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}"
        },
        {
            "type": "chrome",
            "request": "attach",
            "name": "Attach to Chrome",
            "port": 9222,
            "webRoot": "${workspaceRoot}"
          },
        {
            "name": "使用本机chrome调试",
            "type": "chrome",
            "request": "launch",
            "runtimeExecutable": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",//这里填自己的chrome.exe所在目录
            "sourceMaps": true,
            //"url":"http...",//在使用外部服务器时,注释掉file,改用 url, 并将 useBuildInServer 设置为 false
            "file": "${workspaceRoot}/test.html", //#每次需要修改这里的文件地址
            "webRoot": "${workspaceRoot}",
            "userDataDir": "${workspaceRoot}/.vscode/chrome",
        }
    ]
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章