debug -> Add Configuration
-> AddConfiguration
=> {} Node.js:Electron Main
=> {} Chrome : Attach
“runtimeArgs”:["–remote-debugging-prot=9222","."], *可选
"windows":{
"runtimeExecutable":"${WorkspaceFolder}/node_modules/.bin/electron.cmd"
}
注:Electron Main 中的端口 须与 Chrome Attach 中的端口一致
** 可选配置 **
"Compounds":[{
"name":"All",
"configurations":["main","Renderer"] //名称列表
}]
整体配置信息示例
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Main",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"runtimeArgs": ["--remote-debugging-port=9222", "."],
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
}
},
{
"name": "Renderer",
"type": "chrome",
"request": "attach",
"port": 9222,
"webRoot": "${workspaceFolder}"
}
],
"compounds": [
{
"name": "All",
"configurations": ["Main", "Renderer"]
}
]
}