Launching electron: specifying a file vs a directory


What is the difference when it comes to launching your electron app via “npm start”,“electron .”, or “electron ./somedir/.” vs "electron ./somedir/index.html"
It’s worth noting I am just playing around with the basic boilerplate project provided here:

I noticed in the first set of launching options (generic directories) that I get a white background,my variable labels appear and the dev. console is open.

When launching the app by directly calling the html file (electron ./app/app.html) I get a blue background, my variables don’t appear, and my dev console isn’t open.


The BrowserWindow is created from launch from the JavaScript file (in this case background.js) listed in the package.json of the directory you’re pointing it at. So it doesn’t make sense to point at an HTML file. I’d assume that the second thing is Electron failing to launch entirely.

I get a full-on error message, but perhaps electron-boilerplate is doing something, or maybe you’ve got a different Electron version. Either way, you shouldn’t be calling an HTML file directly.


Ah! Thank you!