This is the first time I am building electronjs
app so most probably I don't know what I am doing.
I follow the instruction from the github
and this.
This is my package.json
:
{
"name": "ExampleApp",
"productName": "ExampleApp",
"version": "1.0.0",
"description": "Fun app.",
"license": "MIT",
"repository": "user/repo",
"author": {
"name": "sooon",
"email": "[email protected]",
"url": "Example.com"
},
"build": {
"appId": "com. Example.ExampleApp",
"mac": {
"target": "dmg",
"icon": "build/icon.png"
},
"win": {
"target": "nsis",
"icon": "build/icon.png"
}
},
"scripts": {
"test": "xo",
"start": "electron .",
"pack": "electron-builder --dir",
"dist": "electron-builder"
},
"dependencies": {
"electron-debug": "^1.0.0",
"jquery": "^3.3.1"
},
"devDependencies": {
"devtron": "^1.1.0",
"electron": "^1.8.2",
"electron-builder": "^19.56.0",
"electron-packager": "^8.7.2",
"xo": "^0.18.0"
},
"xo": {
"envs": [
"node",
"browser"
]
}
}
As you can see I have mac
and win
in the build
script. But when I run:
nom run dist
only DMG
file (fully functional) is build. There is not trace of any work with win
app. What had I miss out in the setting?
I am building this with my MacBook running on 10.12.6
. Is it only you can build for your own platform? Can Mac
build for Windows
?
Update01 I took out:
"build": {
"appId": "com.sooonism.pipidance",
"mac": {
"target": "dmg",
"icon": "build/icon.png"
},
"win": {
"target": "nsis",
"icon": "build/icon.png"
}
},
from the package.json
and it still build ok. That means the build
script is located somewhere maybe?
On macOS/Linux you can build Electron app for Windows locally, except Appx for Windows Store (in the future (feel free to file issue) electron-build-service will support Appx target).
Compatible with Mac, Windows, and Linux, Electron apps build and run on three platforms.
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 defaults to building for the current platform. To build both, you need to do something like this in the "script", to build the mac and the window:
"dist-all": "electron-builder -mw"
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