简体   繁体   中英

Can I cross-build electron-forge apps for all platforms?

I'm using electron-forge to build apps for Linux, macOS and Windows. Currently, I can build the macOS distributable natively from macOS, but I need two VMs to build for Linux and Windows.

From each platform VM, I just need to issue the make script:

npm run make

Is it possible to cross-build for all platforms from a single system? Do I need one specific platform to be able to build for the others as well?

What I want to accomplish is to be able to run a build script that will build distributable files for all supported platforms (namely Linux, macOS and Windows) from a single platform, without the need to manually run VMs.

If you're using macOS you can build for all 3 platforms. You can try electron-builder or electron-packager

Here's a simple command to generate distributables for all 3 platforms using electron-builder

electron-builder -mwl

If you are using npm run make it will generate platforms pecific distributables (installers, distribution packages, etc.) but by default it can only generate distributables for your current platform.

Checkout your package.json for more platform specific targets like dmg,zip for Macos

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM