LoginSignup
8
8

More than 5 years have passed since last update.

Visual Studio Code で Electron をデバッグ実行(Windows)

Last updated at Posted at 2016-09-12

WindowsでElectronをデバッグ実行する方法。
(MacやLinuxではちょっといろいろと試してみたけど不慣れなものでうまくいかなった。)
launch.jsonを以下のように設定することで、VSCodeからデバッグ実行することができました。
(Electronを-gでインストールした場合)
ただし、デバッグできるのはメインプロセスのみ。
VSCodeで開いているフォルダが、appフォルダの親のフォルダの場合の設定です。
stopOnEntryをfalseにすれば--debug、trueにすれば--debug-brkオプションで起動されます。

launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Electron Debug",
            "type": "node",
            "stopOnEntry": false,
            "program": "${workspaceRoot}/app/main.js",
            "args": [],
            "cwd": "${workspaceRoot}",
            "preLaunchTask": null,
            "runtimeExecutable": "C:\\Users\\gtk2k\\AppData\\Roaming\\npm\\node_modules\\electron\\dist\\electron.exe",
            "runtimeArgs": [],
            "env": {
                "NODE_ENV": "development"
            },
            "console": "internalConsole",
            "sourceMaps": false,
            "outDir": null
        }
    ]
}
8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8