Build Angular Desktop Apps With Electron (QuickStart)
Check the blog post to re-create this sample from scratch, step by step.
Run in electron using a local file (without hot code reload support)
- Run
npm run electron-build
to build the project and run the application inside electron platform.
Run in electron using a local dev server (WITH hot code reload support)
- Uncomment the code
mainWindow.loadURL('http://localhost:4200');
in the filemain.js
and comment outmainWindow.loadURL(...dist/index.html...)
- Run
npm start
for a dev server. - Run
npm run electron
in a separated terminal, to run the application inside electron platform.
The app will automatically reload if you change any of the source files.
Create a package for a native Windown application
- Run
npm run electron-package-win
.
Now you can run the executable angular-electron.exe
you found under the folder angular-electron-win32-x64
.
Jeff Delaney's sample (Thank you!)
Based onHere's Jeff's post, you can also check the video lesson on youtube and the original source code on github.