![](/img/trans.png)
[英]Include a folder and the files inside it to electron build using electron-builder?
[英]electron-builder - only build for mac but set to build mac and win
这是我第一次建立electronjs
应用程序,所以很可能我不知道我在做什么。
我按照github
的指示和这个 。 这是我的package.json
:
{
"name": "ExampleApp",
"productName": "ExampleApp",
"version": "1.0.0",
"description": "Fun app.",
"license": "MIT",
"repository": "user/repo",
"author": {
"name": "sooon",
"email": "Example@gmail.com",
"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"
]
}
}
正如你所看到的,我在build
脚本中有mac
并win
。 但是当我跑步时:
nom run dist
只构建DMG
文件(功能齐全)。 win
app没有任何工作的痕迹。 我错过了什么?
我正在用10.12.6
运行的MacBook构建它。 是否只有你可以为自己的平台构建? Mac
可以为Windows
构建吗?
我拿出Update01 :
"build": {
"appId": "com.sooonism.pipidance",
"mac": {
"target": "dmg",
"icon": "build/icon.png"
},
"win": {
"target": "nsis",
"icon": "build/icon.png"
}
},
从package.json
,它仍然构建好。 这意味着build
脚本可能位于某个地方?
electron-builder默认为当前平台构建。 要构建两者,您需要在“脚本”中执行类似的操作,以构建mac和窗口:
“dist-all”:“电子建设者-mw”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.