Npm script, Electron and environment variables

In short

In app:

var isDev = process.env.TODO_DEV ? process.env.TODO_DEV.trim() == "true";  

In package.json let's say we have:

"start": "electron . --enable-logging --remote-debugging-port=9222"

With cross-env package:

"dev": cross-env TODO_DEV=true npm run start

or without dependencies:

"dev:mac": TODO_DEV=true npm run start,
"dev:win": SET TODO_DEV=true && npm run start

Longer version

If you're working with npm scripts (or

Read More

Publishing for Windows

This article is part of the Distributing Electron apps series.

If you're looking to publish for OS X, check out previous post.

What's the endgame?

To build EXE installer for our app and be able to automatically update.

Creating installer

If you followed through article where I explained electron-builder, you're mostly done to build distributable for Windows.

Let's clear some things first. It's not the same if you run electron-builder

Read More

Distributing Electron apps

For couple of days I've been looking at building Electron apps for OS X and Windows. Finally I made some progress and have successfully created installers with automatic updates for both platforms. Although there is some official documentation and some articles, I wasn't able to get it to work OOTB. That's why I decided to make in-depth series about it.

The plan

I plan to add Squirrel updater to my

Read More