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)
相关推荐
AZ996ZA6 小时前
自学linux的第二十一天【DHCP 服务从入门到实战】
linux·运维·服务器·php
lxysbly6 小时前
md模拟器安卓版带金手指2026
android
_OP_CHEN6 小时前
【Linux系统编程】(二十八)深入 ELF 文件原理:从目标文件到程序加载的完整揭秘
linux·操作系统·编译·c/c++·目标文件·elf文件
Fleshy数模6 小时前
MySQL 表创建全攻略:Navicat 图形化与 Xshell 命令行双模式实践
linux·mysql
儿歌八万首7 小时前
硬核春节:用 Compose 打造“赛博鞭炮”
android·kotlin·compose·春节
神梦流7 小时前
GE 引擎的非标准数据流处理:稀疏张量与自定义算子在图优化中的语义保持
linux·运维·服务器
.小墨迹8 小时前
apollo学习之借道超车的速度规划
linux·c++·学习·算法·ubuntu
Lsir10110_8 小时前
【Linux】中断 —— 操作系统的运行基石
linux·运维·嵌入式硬件
Sheffield8 小时前
command和shell模块到底区别在哪?
linux·云计算·ansible
历程里程碑8 小时前
Linux20 : IO
linux·c语言·开发语言·数据结构·c++·算法