5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Electron用のlaunch.json

Last updated at Posted at 2016-11-13

VisualStudioCodeからElectronを起動するためのlaunch.jsonの書き方。
GitHubで検索して見つかる基本パターンは下記。

launch.json
{
    "version": "0.1.0",
    "configurations": [
        { 
            "name": "Launch Electron App",
            "type": "node",
            "program": "${workspaceRoot}/main.js",
            "stopOnEntry": false,
            "args": [],
            "cwd": "${workspaceRoot}",
            "runtimeExecutable": "${workspaceRoot}/node_modules/electron-prebuilt/dist/electron.exe",
            "env": { }, 
            "sourceMaps": false
        } 
    ]
}

一方、electron-prebuildをinstall -gした場合は、これでは動かないので、以下のように書き換える必要がある。

launch.json
{
    ...
            "runtimeExecutable": "[nodeのルートフォルダ]/bin/electron.cmd",
    ...
}

起動の仕方とかは下記の記事などを参照。
Visual Studio CodeでNode.jsデバッグ

5
5
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
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?