使用 VSCode 进行主进程调试
1. 在 VSCode 中打开一个 Electron 工程。
$ git clone git@github.com:electron/electron-quick-start.git
$ code electron-quick-start2. 使用以下配置添加一个文件 .vscode / launch.json:
.vscode / launch.json:{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Main Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"args" : ["."]
}
]
}3. 调试
Last updated