基于electron-builder打包electron项目的配置

在electron项目使用electron-builder进行打包的配置

  "build": {
    "productName":"书阙",
    "asar": true,
    "extends": null,
    "files": [
      "src/**/*",
      "public/**/*"
    ],
    "electronDownload":{
      "mirror":"https://npm.taobao.org/mirrors/electron/"
    },
    "directories": {
      "buildResources": "assets"
    },
    "extraMetadata": {
      "main": "src/index.js"
    },
    "win": {
      "icon": "./public/icon/favicon.ico"
    },
    "nsis": {
      "oneClick":false,
      "allowToChangeInstallationDirectory": true,
      "installerIcon": "./public/icon/favicon.ico"
    }
  }


主要是nsis部分
oneClick 是否单击安装
allowToChangeInstallationDirectory 是否允许修改安装目录
installerIcon 安装文件icon

electron
electron-builder

关于作者

落雁沙
吹牛逼大王
获得点赞
文章被阅读