by WebspaceTeam
Electron application boilerplate based on Nuxt.js for crossplatform desktop application development
Electron Nuxt core components:
- Electron
- Electron builder
- Nuxt.js
Building for Windows NSIS target works perfect. However, there are some tricky moments when you are building for MacOS (both DMG and Mac App Store distribution). See MacOS section.
# install dependencies
$ npm run install
# serve with hot reload for Renderer process
$ npm run dev
# build for Windows
$ npm run build:win:64
$ npm run build:win:32
$ npm run build:win:both
# build for MacOS
$ npm run build:mac:dmg
$ npm run build:mac:store
/build
folder stores icon and additional scripts for Electon Builder
/mainprocess
includes JavaScript for the Electron main process
/src
folder structure typical to any Nuxt.JS project
You need to create provisioning profile at developer.apple.com and place it to build
folder as embedded.provisionprofile
.
To distribute your application as DMG image it should be signed and notarized.
To sign application change CERTIFICATE NAME (***********)
in package.json
file in build:mac:dmg
section to yourth one.
To notarize application change [email protected]
and application password
in package.json
file in build:mac:dmg
section to yourth one.
Additionaly check (add or remove) entitlements at build/entitlements.mac.plist
Attention: currently only Electron 5.0.13 and 6.1.7 can be publised to Mac App Store. Do not forget to change Electron version in package.json
To publish application at Mac App Store it should be sandboxed and all binaries should be signed. Appropriate entitlements needs to be added.
Steps to prepare your application for publication:
- Change
CERTIFICATE NAME (***********)
inpackage.json
file inbuild:mac:store
section to yourth one. - Check (add or remove) entitlements at
build/entitlements.mas.plist
. ReplaceDEVELOPERID.full.package.name
inbuild/entitlements.mas.plist
- In
build/resignAndPackage.sh
changeAPPLICATION NAME
to your application name (should be asproductName
inpackage.json
). ReplaceCERTIFICATE NAME (***********)
to your certificate name in two places. - Binaries that are listed in
build/resignAndPackage.sh
valid for Electron 5.0.13. Should be updated for another Electron version or in case additional binaries will be used. To find binaries runfind -H YourAppBundle -print0 | xargs -0 file | grep "Mach-O .*executable"
(see source). Binaries fromnode_modules
can be unpacked by listing them inasarUnpack
key inpackage.json
. - Build
dist/mas/$APP-mac_store.pkg
should be uploaded to Mac App Store via Transporter application
- There is a bug in Electron builder. Only one target for
mac
can be specified.
MIT © Electron Nuxt by WebspaceTeam