O'Reilly logo

Cross-platform Desktop Application Development: Electron, Node, NW.js, and React by Dmitry Sheiko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Packaging and distribution

When we worked with File Explorer and NW.js, we used the nwjs-builder tool for packaging our application. The Electron has an even more sophisticated tool--electron-builder (https://github.com/electron-userland/electron-builder). Actually, it builds an application installer. The range of target package formats electron-builder supports is impressive. Then, why not try packaging our application? First, we install the tool:

npm i -D electron-builder 

We add a new script to the manifest--./package.json:

 "scripts": {     ...      "dist": "build"   }, 

We also set an arbitrary ID for the application in field build:

 "build": {     "appId": "com.example.chat"   },  

We definitely want to provide the application with an icon, so ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required