linux electron-forge离线打包关键配置

信息来源:https://electron.github.io/packager/main/interfaces/Options.html#electronZipDir

提前下载好electron zip文件放在合适位置,然后编辑根目录下forge.config.js,添加

electronZipDir:'your zip path'

比如:

c 复制代码
const { FusesPlugin } = require('@electron-forge/plugin-fuses');
const { FuseV1Options, FuseVersion } = require('@electron/fuses');

module.exports = {
  packagerConfig: {
    asar: true,
    electronZipDir:'/root/.cache/electron/electron/bfb813983674012136cfb05f3b9548e0633c4db931138ebec3108214a8c8a0a2'
  },
  rebuildConfig: {},
  makers: [
    {
      name: '@electron-forge/maker-squirrel',
      config: {},
    },
    {
      name: '@electron-forge/maker-zip',
      platforms: ['darwin'],
    },
    {
      name: '@electron-forge/maker-deb',
      config: {},
    },
    {
      name: '@electron-forge/maker-rpm',
      config: {},
    },
  ],
  plugins: [
    {
      name: '@electron-forge/plugin-auto-unpack-natives',
      config: {},
    },
    // Fuses are used to enable/disable various Electron functionality
    // at package time, before code signing the application
    new FusesPlugin({
      version: FuseVersion.V1,
      [FuseV1Options.RunAsNode]: false,
      [FuseV1Options.EnableCookieEncryption]: true,
      [FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
      [FuseV1Options.EnableNodeCliInspectArguments]: false,
      [FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
      [FuseV1Options.OnlyLoadAppFromAsar]: true,
    }),
  ],
};
![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/400daccc94794249bb5735e8abef6ab9.png)
相关推荐
Hello World . .19 分钟前
【嵌入式学习笔记 Day 1】
linux·数据结构·笔记
叼烟扛炮21 分钟前
Linux 学习笔记(三十一):线程概念、底层分页机制与初体验
linux·运维·服务器·笔记·学习·1024程序员节
星恒随风22 分钟前
Linux Socket UDP编程(一):手写UDP回显服务器与客户端,从socket、bind、recvfrom到网络字典服务器完整实战
linux·服务器·网络·笔记
H.莓飛24 分钟前
【数据结构】归并与外排序
linux·服务器·c语言·开发语言·数据结构·visual studio
junwua27 分钟前
qnx hypervisor 的中文版
linux·运维·服务器·自动驾驶
小猪佩奇TONY27 分钟前
Linux 内核学习(19) --- linux waitqueue
linux·学习·waitqueue
by209999 小时前
Linux 基础指令与文件操作
linux·1024程序员节
Escalating_xu10 小时前
【Linux 网络编程】手写序列化与反序列化:从 x op y 到能校验的文本协议
linux·运维·网络
美狐美颜SDK开放平台11 小时前
准备开发直播APP?视频美颜SDK接入前的十项检查清单
android·ios·音视频·直播美颜sdk·视频美颜sdk
传奇开心果编程11 小时前
【Jetpack Compose娓娓道来】第26课:Repository模式与数据层设计——数据的唯一入口
android·移动开发·1024程序员节·jetpack compose·编程语言理论·编程框架·声明式ui