Visual Studio代码。
使用sourcemaps将Typescript文件编译为JavaScript文件。
生成的launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceRoot}"
},
{
"type": "chrome",
"request": "attach",
"name": "Attach to Chrome",
"port": 9222,
"webRoot": "${workspaceRoot}"
}
]
}
Chrome以参数:--remote-debugging-port = 9222
启动但我还是得到了
无法连接到目标:connect ECONNREFUSED 127.0.0.1:9222
尝试使用“附加到Chrome”选项进行调试时,VSCode中出现错误。