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)
相关推荐
_阿南_29 分钟前
Android文件读写和分享总结
android
阿里云云原生9 小时前
破局 Electron 监控盲区:基于 WASM 与 IPC 桥接的零侵入可观测 SDK 设计
electron
通玄9 小时前
Jetpack Compose 入门系列(六):Navigation 3 页面导航
android
rocpp12 小时前
Android 多语言切换实战:从 Context 到 Android 13 应用语言适配
android·kotlin
释然小师弟13 小时前
Android开发十年:反思与回顾
android·后端·嵌入式
Sokach101514 小时前
Linux Shell 脚本从零到能用:一个新手的一天学习总结
linux
黄林晴15 小时前
用了这么久 Koin Scope,原来一直都用错了?
android·kotlin
爱勇宝1 天前
我做了一个只用来搜歌词的小 App
android·前端·后端
AlfredZhao1 天前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
众少成多积小致巨1 天前
JNI (Java Native Interface) 技术手册中文参考指南
android·java·c++