Solve the problem of slow download dependency during the packaging of electric builder
Problem description
• electron-builder version=22.5.1 os=10.0.18362 • loaded configuration file=package.json ("build" field) • writing effective config file=dist\builder-effective-config.yaml • packaging platform=win32 arch=x64 electron=8.2.3 appOutDir=dist\win-unpacked • default Electron icon is used reason=application icon is not set • downloading url= https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.6.0/winCodeSign-2.6.0.7z size=5.6 MB parts=1
resolvent
-
Resolve the slow download of Electron
New Project Root Directory .npmrc File, add the following environment variables: ELECTRON_MIRROR= https://npm.taobao.org/mirrors/electron/ This item sets the Electron image source as Taobao image source. -
Solve the slow download of NSIS and winCodeSign
Draw like a cat, in .npmrc Same settings in ELECTRON_BUILDER_BINARIES_MIRROR Image source address. cnpm also provides the corresponding image source: ELECTRON_BUILDER_BINARIES_MIRROR= http://npm.taobao.org/mirrors/electron-builder-binaries/ In this way, the required tool chain files can be downloaded at a high speed.
the selected readings
-
Nsis storage location C:\Users\admin\AppData\Local\electron-builder\Cache\winCodeSign -
WinCodeSign storage location C:\Users\admin\AppData\Local\electron-builder\Cache\winCodeSign