Sublime build for Electron apps

If you use Sublime Text, you can define your own build to run Electron app. In Sublime you can create new build configuration with navigating to Tools -> Build Systems -> New Build System...

Paste following code and save the file as Electron.sublime-build:

{
    "cmd": ["node_modules/.bin/electron", ".", "--enable-logging"],
    "working_dir": "${project_path:${folder}}",
    "path": "/usr/local/bin/"
}

If you installed Electron globally, use:

"cmd": ["electron", ".", "--enable-logging"]

Note: Option --enable-logging will transfer all your logging to Sublime console.

New build should appear under Electron in list of build systems. Choose it and test it out with Cmd+B (or whatever shortcut you have defined for running build).

About Vjekoslav Ratkajec

Software developer from Zagreb, Croatia. Love programming, running, hiking and biking. Adore nature and animals. Also author of this blog.

Comments