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)
相关推荐
火柴就是我37 分钟前
让我们实现一个更好看的内部阴影按钮
android·flutter
砖厂小工7 小时前
用 GLM + OpenClaw 打造你的 AI PR Review Agent — 让龙虾帮你审代码
android·github
张拭心8 小时前
春节后,有些公司明确要求 AI 经验了
android·前端·人工智能
张拭心8 小时前
Android 17 来了!新特性介绍与适配建议
android·前端
Kapaseker10 小时前
Compose 进阶—巧用 GraphicsLayer
android·kotlin
黄林晴11 小时前
Android17 为什么重写 MessageQueue
android
一拳不是超人1 天前
Electron主窗口弹框被WebContentView遮挡?独立WebContentView弹框方案详解!
前端·javascript·electron
chlk1231 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
阿巴斯甜1 天前
Android 报错:Zip file '/Users/lyy/develop/repoAndroidLapp/l-app-android-ble/app/bu
android
舒一笑1 天前
Ubuntu系统安装CodeX出现问题
linux·后端