website/docs/guides/debugging-in-vscode.md
Open a NodeGui project in VSCode.
$ git clone https://github.com/sedwards2009/nodegui-simple-starter.git
$ code nodegui-simple-starter
Add a file .vscode/launch.json with the following configuration:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Qode Process",
"type": "node",
"request": "launch",
"cwd": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/qode",
"windows": {
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/qode.exe"
},
"args": ["./dist/index.js"],
"outputCapture": "std"
},
{
"command": "npx webpack --devtool source-map && npx qode --inspect ./dist/index.js",
"name": "Debug for Cmd",
"request": "launch",
"type": "node-terminal"
},
{
"command": "npx webpack --devtool source-map; npx qode --inspect ./dist/index.js",
"name": "Debug for PowerShell",
"request": "launch",
"type": "node-terminal"
},
]
}
Tip:
Debugging
Set some breakpoints in index.js, and start debugging in the Debug View. You should be able to hit the breakpoints.