Electron packaging
Summary: How to package an electron application
 javascript  electron

Two method, electron-builder or electron-packager


npm isntall -g electron-packager and npm isntall -g electron-builder

Use electron packager:

electron-packager <sourcedir> <appname> <platform> <architecture> <electron version> <optional options>


electron-packager . ApplicationName --win --out ./out --arch=x64 --overwrite --ignore=node_module

Use electron builder

add this script into your package.json

"build": {
    "appId": "com.xxx.app",
    "mac": {
      "target": ["dmg","zip"]
    "win": {
      "target": ["nsis","zip"]
Then, use electron-builder. You can also add args like electron-builder --win --x64

Latest Updated Time:2019-05-20 10:02:41