0.0.7 • Published 6 years ago
webstorm-run-electron v0.0.7
Helper to enable Electron debugging in WebStorm (current version 2017.2). Until the company releases some designated Electron debugging profile.
Problem: WebStorm calls the Electron executable like Node, but uses different parameters to communicate the debugging port.
Solution: map potentially wrong parameters to what Electron expects.
This how to use it:
npm install --save-dev webstorm-run-electron
In WebStorm create a Run/Debug Configuration with the following settings:
- Inherit (+) from NodeJS.
- Set Node interpreter to the absolute path of this tool, like
{your-project-home}/node_modules/.bin/webstorm-run-electron
. To be certain it's best to just browse for it. - All the other parameters just set to your needs.
- If you want to debug the renderer, pass
--remote-debugging-port=9222
in the Node parameters field. You can then attach a secondary debug session of the Chromium Remote kind to that remote process.
Now launch that configuration. In the console you will see the process invocation of the tool printed out, for instance:
/home/me/project/node_modules/.bin/webstorm-run-electron --inspect-brk=59993 --remote-debugging-port=9222 /home/me/project/main.js
webstorm-run-electron: /home/me/project/node_modules/.bin/electron --inspect-brk=59993 --remote-debugging-port=9222 /home/me/project/main.js
Notice how --inspect-brk
is now present, instead of --debug-brk
.