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)
相关推荐
乱蜂朝王4 小时前
Ubuntu 20.04安装CUDA 11.8
linux·运维·ubuntu
梁洪飞5 小时前
clk学习
linux·arm开发·嵌入式硬件·arm
~光~~5 小时前
【嵌入式linux驱动——点亮led】基于鲁班猫4 rk3588s
linux·点灯·嵌入式linux驱动
yuanmenghao6 小时前
车载Linux 系统问题定位方法论与实战系列 - 车载 Linux 平台问题定位规范
linux·运维·服务器·网络·c++
低调小一7 小时前
深度复盘:KMP 在字节跳动的工程化落地实践
android·kotlin
qq_589568107 小时前
centos6.8镜像源yum install不成功,无法通过镜像源下载的解决方式
linux·运维·centos
weixin_516023077 小时前
linux下fcitx5拼音的安装
linux·运维·服务器
hunter14508 小时前
Linux 进程与计划任务
linux·运维·服务器
楼田莉子8 小时前
Linux学习之磁盘与Ext系列文件
linux·运维·服务器·c语言·学习
陌上花开缓缓归以8 小时前
linux 怎么模拟系统panic重启
linux·运维·服务器