如何仅使用修改后的模块/文件发布电子应用程序?

问题描述

我正在使用电子生成器打包应用程序并在github私有存储库上发布,还实现了电子更新程序在后台自动更新应用程序,一切正常。

但是问题是每次我使用以下脚本在github上发布应用程序

"scripts": {
      "deploy": "electron-builder --config=electron-builder.yml build --win --x64 --ia32 --publish always" 
 },

电子生成配置文件

directories:
  output: dist
  buildresources: build

nsis:
  allowtochangeInstallationDirectory: true
  oneClick: false
  perMachine: false
  deleteAppDataOnUninstall: true
  license: ./license.txt

win:
  target:
    - target: nsis
  icon: ./icons/logo.png   
  
mac:
  icon: ./icons/icon.icns
  target:
    - target: dmg
    - target: zip

  hardenedRuntime: true
  gatekeeperAssess: false
  entitlements: build/macos/entitlements.mac.plist
  entitlementsInherit: build/macos/entitlements.mac.plist

dmg:
  sign: false

linux:  
  target:
    - target: deb
    - target: tar.gz
    - target: snap 

asar: true
buildDependenciesFromSource: true
compression: store

publish:
  provider: github
  token: xxxxxxxxxxxxxxxxxxxxxxxxxxx
  releaseType: release

Pakcage.json

{
  "name": "testapp","productName": "testapp","version": "0.0.1","description": "My Electron application description","main": "src/main.js","scripts": {
    "start": "electron-forge start","package": "electron-forge package","make": "electron-forge make","publish": "electron-forge publish","lint": "echo \"No linting configured\"","clean": "npm cache clean --force","build": "electron-builder --config=electron-builder.yml build --win --x64 --ia32 --publish never","deploy": "electron-builder --config=electron-builder.yml build --win --x64 --ia32 --publish always","postinstall": "electron-builder install-app-deps"
  },"repository": {
    "type": "git","url": "repourl"
  },"keywords": [],"author": {
    "name": "name","email": "emailid"
  },"license": "MIT","build": {
    "appId": "appid","category": "Business","publish": [
      {
        "provider": "github","private": true,"owner": "user","repo": "reponmae"
      }
    ]
  },"config": {
    "forge": {
      "packagerConfig": {},"makers": [
        {
          "name": "@electron-forge/maker-squirrel","config": {
            "name": "DesktopDMS"
          }
        },{
          "name": "@electron-forge/maker-zip","platforms": [
            "darwin"
          ]
        },{
          "name": "@electron-forge/maker-deb","config": {}
        },{
          "name": "@electron-forge/maker-rpm","config": {}
        }
      ]
    }
  },"dependencies": {
    "@progress/kendo-ui": "^2020.2.617",//i kNow kendo and synfusion UI packages increasing app size
    "@syncfusion/ej2": "^18.1.59","axios": "^0.19.2","electron-json-storage": "^4.2.0","electron-updater": "^4.3.5","jquery": "^3.5.1","jsrender": "^1.0.6","material-datetime-picker": "^2.4.0","materialize-css": "^1.0.0-rc.2"
  },"devDependencies": {
    "@electron-forge/cli": "^6.0.0-beta.52","@electron-forge/maker-deb": "^6.0.0-beta.51","@electron-forge/maker-rpm": "^6.0.0-beta.51","@electron-forge/maker-squirrel": "^6.0.0-beta.51","@electron-forge/maker-zip": "^6.0.0-beta.51","electron": "9.0.4","electron-builder": "^22.8.0",}
}

电子制造商总是创建具有相同大小[在250-300MB之间]的新软件包/安装程序/应用,而电子更新程序正在下载该应用的更新版本。

所以我该如何减小渐进发行版的大小[或只发行经修改的模块/文件],因为每次下载完整的应用程序都非常令人沮丧。

我尝试了压缩[没有太大的区别],还删除了一些未使用的软件包。 据我所知, VS Code / Zoom / Slack 正在管理这种情况,但我不知道如何。

我需要一些帮助/指导来实现它。预先感谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)