gpt4 book ai didi

electron - Electron 生成器,mac dmg软件包,包括用于构建阶段的文件

转载 作者:行者123 更新时间:2023-12-03 12:35:13 25 4
gpt4 key购买 nike

我正在使用electron-builder打包用于Windows,Mac和Linux的应用程序。

生成的软件包大小均相同,但对于Mac,文件大小是该大小的两倍。

有一个巨大的app.asar.unpacked/文件夹,其中包含构建阶段不需要的框架。

如何配置 electronicbuilder 跳过这些文件?

myApp.app enter image description here

这是我的 project.json

{
"name": "KioskeTV",
"description": "TV Application",
"version": "1.0.0",
"main": "app/src/main.js",
"scripts": {
"postinstall": "install-app-deps",
"start": "npm install && electron .",
"pack": "build --dir",
"dist": "build",
"dist:win": "build --platform win32"
},
"repository": "https://github.com/electron/electron-quick-start",
"keywords": [
"nobj.io",
"service",
"launcher"
],
"author": "Nebular Streams SLU",
"license": "Proprietary",
"devDependencies": {
"electron": "^2.0.0",
"electron-builder": "^20.26.1"
},
"build": {
"appId": "nobjio",
"dmg": {
"contents": [
{
"x": 110,
"y": 150
},
{
"x": 240,
"y": 150,
"type": "link",
"path": "/Applications"
}
]
},
"linux": {
"target": [
"AppImage",
"deb"
]
},
"win": {
"target": "portable",
"icon": "build/icon.ico"
}
},
"dependencies": {
"app-builder-lib": "^20.27.1"
}
}

最佳答案

“忽略是一个 Electron 打包程序选项,必须在构建中指定”
这可能会让您指出正确的方向。祝你好运。
在构建中是这样的:

ignore: function (
// TODO: add logic here
console.log(file);
return false;

另一个可能性:
使用 https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#ignore作为正则表达式。

关于electron - Electron 生成器,mac dmg软件包,包括用于构建阶段的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51823184/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com