This is a starter of angular (2 and above) and electron.Its a working demo (like DHC) of electron with [angular] using Webpack, ngrx
git clone https://github.com/erha19/Angular2-electron-quick-start.git
Install dependencies
cd Angular2-electron-quick-start
npm install
Run the example
npm start
Hot reload on electron
npm run watch:electron
You can also run npm run server:dev
to start a webpack-dev-server to debug you code on browser.
When you use Linux or OSX , you need to change the command in package.json
,just change set
to export
.
Toggle DevTools:
- OSX: Cmd Alt I or F12
- Linux: Ctrl Shift I or F12
- Windows: Ctrl Shift I or F12
The app has support for packaging using 'electron-packager'
$ npm run package -- --all
Will run the package for OSX. You can also provide additional options to the package command such as
- --name : The package name
- --all : Will packaget the application to all the platforms
- --arch : Arches to be provided
- --icon : The icon for the app
Modify electron-builder.yml to edit package info.
For a full list of options see: https://github.com/electron-userland/electron-builder/wiki/Options.
Create a package for OSX, Windows and Linux
npm run pack
Or target a specific platform
npm run pack:mac
npm run pack:win
npm run pack:linux
npm run test