Add renderer process debugging

This commit is contained in:
JannisX11 2025-03-21 18:41:20 +01:00
parent 3928c8d24e
commit d790320469
3 changed files with 27 additions and 3 deletions

8
.vscode/launch.json vendored
View File

@ -26,6 +26,14 @@
"skipFiles": [
"<node_internals>/**"
]
},
{
"name": "Debug Renderer",
"type": "chrome",
"request": "attach",
"port": 9223,
"webRoot": "${workspaceFolder}",
"timeout": 30000
}
]
}

View File

@ -22,14 +22,30 @@ Check out the [Contribution Guidelines](CONTRIBUTING.md).
## Launching Blockbench
To launch Blockbench from source, you can clone the repository, navigate to the correct branch and launch the program in development mode using the instructions below. If you just want to use the latest version, please download the app from the website.
To launch Blockbench from source, you can clone the repository, navigate to the correct branch and launch the program in development mode using the instructions below.
If you just want to use the latest version, please download the app from the website.
### Setup Repository
* Install [NodeJS](https://nodejs.org/en/).
* Then install all dependencies via
`npm install`
* Finally, launch Blockbench using
### Run in Electron
Use this command or press Ctrl + Shift + B to launch Blockbench in Electron:
`npm run dev`
To enable debugging in VS Code, switch to the **Run & Debug** tab, select the **"Debug Renderer"** configuration, and press the green arrow button to launch.
Now you can set breakpoints and debug inside VSCode.
### Run the web app
Use this command to launch the web app locally:
`npm run serve`
Now you can open the web app in your browser under http://localhost:3000
## Plugins

View File

@ -120,7 +120,7 @@
]
},
"scripts": {
"dev": "concurrently --raw \"electron .\" \"node ./build.js --target=electron --watch\" --kill-others --success=first",
"dev": "concurrently --raw \"electron --remote-debugging-port=9223 .\" \"node ./build.js --target=electron --watch\" --kill-others --success=first",
"serve": "node ./build.js --target=web --serve",
"electron": "electron .",
"build-web": "node ./build.js --target=web",