Skip to content

Commit

Permalink
修复远程调试出现“Debugging connection was closed.Reason:WebSocket disconnecte…
Browse files Browse the repository at this point in the history
…dReconnectwhen readybyreopeningDevTools.”的问题,添加对Renderer进行调试的方式Renderer(DEBUG)
  • Loading branch information
pacinor committed Apr 10, 2024
1 parent 3fa2a2c commit b953762
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
"type": "node",
"sourceMaps": true
},

{
Expand All @@ -21,6 +22,7 @@
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"runtimeArgs": [
"--remote-debugging-port=9222",
"--remote-allow-origins=*",
"${workspaceFolder}/dist/main/index.cjs",
],
"env": {
Expand All @@ -35,8 +37,21 @@
"type": "chrome",
"request": "launch",
"name": "Renderer(inspector)",
"url": "http://localhost:9222",
"webRoot": "${workspaceFolder}/dist/packages/renderer",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"runtimeArgs": [
"--remote-debugging-port=9222",
"--remote-allow-origins=*",
"${workspaceFolder}/dist/main/index.cjs",
],
"env": {
"DEBUG": "true",
},
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
},
"sourceMaps": true,
"url": "http://localhost:3344",
"webRoot": "${workspaceFolder}/packages/renderer",
},
{
"type": "node",
Expand All @@ -45,6 +60,8 @@
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"runtimeArgs": [
"${workspaceFolder}/dist/main/index.cjs",
"--remote-debugging-port=9222",
"--remote-allow-origins=*",
],
"env": {
"VITE_DEV_SERVER_HOST": "127.0.0.1",
Expand All @@ -65,7 +82,15 @@
],
"compounds": [
{
"name": "DEBUG",
"name": "main(DEBUG)",
"configurations": [
"Serve(inspector)",
"Main(inspector)",
],
"preLaunchTask": ""
},
{
"name": "Renderer(DEBUG)",
"configurations": [
"Serve(inspector)",
"Main(inspector)",
Expand Down

0 comments on commit b953762

Please sign in to comment.