Can somebody explain to me how electron-builder config work? I can't understand 95% of the things. Everything bellow API is somehow confusing. There are 0 examples of actually how something should be added to the build
object. I mean, look at a simple dev request: I want to create windows and linux build. I copy/paste-ed some code and I came out with the fillowing:
{
"name": "Test",
"version": "1.0.0",
"author": "Test Ltd.",
"description": "Test",
"devDependencies": {
...
},
"build": {
"appId": "Test",
"extraFiles": {
"from": "./build",
"to": "./dist"
},
"win": {
"icon" : "build/images/icon.ico",
"target": ["portable"]
},
"linux": {
"icon" : "build/images/icon.png",
"target": ["pacman"]
}
},
"scripts": {
"pack": "build --dir",
"dist": "build"
}
}
dist
folder there is a folder called win-unpacked
and one .exe file. The linux package is not there. Why?WinBuildOptions
work - I should write "win" in the "build" object of package.json
.Squirrel Events
? I red this, but can't understand it from plain text.In simple terms, appId is a name that the client's computer is using to identify. This is particularly useful and you must've noticed it when you are trying to launch an app thar's already open, your OS would open the minimised version, rather than opening a new instance of the same app.
electron-builder nsis-web target for electron-forge. Recommended to build electron-forge project using electron-builder directly.
Take a look a the api options in the github repo for electron-builder, which uses the windows build options and linux build options to work. The descriptions of each item are laid out next to the attribute/property of the config.
This is a contrived example, but should at least give the structure of how it should look for windows and linux:
"build":{
"appid":"yourid",
"asar": true
"linux":{
"category": "...",
"target": "..."
},
"win":{
"target": "...",
"certificateFile":"...",
"publisherName": "..."
}
}
There is a multi platform build page you can review. Specifically, to target a certain arch, you use the command line flags. From the documentation:
By default build for current platform and current arch. Use CLI flags --mac, --win, --linux to specify platforms. And --ia32, --x64 to specify arch.
Typically, this is specified as an npm script, and passed along that way when you run the electon-build command. In terms of building on platforms and potentially missing information, please see this quote:
Don't expect that you can build app for all platforms on one platform.
There appears to be extra setup and configuration needed to develop a linux and windows version based on the specific OS you are using. I would look at what that page states in terms of dependencies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With