In this section, we are going to learn how to package the Electron application for distribution.
Let's start by installing the electron-builder library and configuring the package scripts:
- Run the following command to install the library:
npm install -D electron-builder
You can find more information, examples, and documentation about the electron-builder library by visiting the official repository: https://github.com/electron-userland/electron-builder.
- Update the package.json file and include the pack-app and dist-app scripts. Also, provide the homepage address, as shown in the following code:
"homepage": "./",
"scripts": {
"electron": "electron .",
"start": "react-scripts start",
"build": "react-scripts build",
"test"...