Skip to content

Build Configurations

Once the module installation is complete, you can simply build the platform package with the command below.

# For Windows (.exe, .appx)
$ npm run build:win

# For macOS (.dmg)
$ npm run build:mac

# For Linux (.rpm, .deb, .snap)
$ npm run build:linux

# All platform (.exe, .appx, .dmg, .rpm, .deb, .snap) - see below description
$ npm run build:all

The built packages can be found in release/{version} location.

For more information, please refer to the following article:

What do I need to do for a multi-platform build?

To create a package for each OS, you must build it on the same OS. For example, a package for macOS must be built on a macOS machine.

However, you can build packages for Windows, macOS, and Linux all at once on one OS. However, this might require some preparation.

macOS is recommended if you want to build multiple platforms simultaneously on one platform. Because it can be configured with just a few very simple settings.

You can perform multi-platform builds at once with the following command. Alternatively, you can just do it for the OS you want via the individual build commands above.

$ npm run build:all

Multipass configuration may be required for Linux builds. Learn more about Multipass through the following link:

To learn more about multiplatform builds, see the following articles:

Reduce bundle size by excluding development files

You can exclude files you don't need at build time by adding a file pattern to the files property of buildAssets/builder/config.ts. This will save bundle capacity.

Below is an unnecessary node_modules file pattern that can further save bundles. Depending on the project, using the rules below may cause problems, so please review it before using.


Build settings for projects that use Native Node modules

For projects that use the Native Node Module, add the following script to your package.json: When installing dependencies, electron-builder will take care of any modules that require rebuilding.

  "scripts": {
    "postinstall": "electron-builder install-app-deps"