Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Debugging using vscode #661

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 80 additions & 18 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,81 @@
{
"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"
},
"program": "${workspaceRoot}/dist/electron.js",
"args" : ["."],
"outputCapture": "std",
"sourceMaps": true
}
]
}
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"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"
},
"program": "${workspaceRoot}/dist/electron.js",
"args": [
"."
],
"outputCapture": "std",
"sourceMaps": true
},
{
"name": "Electron: Main",
"type": "node", //use the node debugger that comes with VS Code
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd"
},
"program": "${workspaceRoot}/dist/electron.js",
"runtimeArgs": [
// "--enable-logging",
//open debugging port for renderer process
"--remote-debugging-port=9222"
],
"outFiles": [
"${workspaceFolder}/dist/*.js"
],
"args": [
"."
],
"outputCapture": "std",
"sourceMaps": true,
"resolveSourceMapLocations": [
//use source maps for files in workspace folder
"${workspaceFolder}/**",
//but ignore everything in the node_modules folder
"!**/node_modules/**"
],
"env": {
"ELECTRON_DISABLE_SECURITY_WARNINGS": "true",
"ELECTRON_IS_DEV": "1"
},
},
{
// Please comment BrowserWindow.webContents.openDevTools() before using this debugging
// https://stackoverflow.com/a/57085144
"name": "Electron: Renderer",
//use the Chrome debugger that comes with VS Code
"type": "chrome",
"request": "attach",
//use debug port opened in Electron: Main configuration
"port": 9222,
"webRoot": "${workspaceFolder}",
"timeout": 30000,
}
],
"compounds": [ //launch multiple configurations concurrently
{
"name": "Electron: All",
"configurations": [
"Electron: Main",
"Electron: Renderer"
],
//recompile before debugging (execute the compile script defined in package.json)
"preLaunchTask": "npm: build",
}
]
}