渲染进程调试(进入网页版的f12调试模式):
ctrl shift i
View->toggle Developer tools
主进程调试:
vscode中左侧竖直栏第四个运行小虫子按钮,在上方设置中查找launch.js
将其中内容替换成
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
},
"args" : ["."]
}
]
}
点击左上角运行按钮就可进行调试
主进程调试配置图: