Project build thanks to : https://github.com/maximegris/angular-electron
Currently runs with:
- Angular v13.3.1
- Electron v18.0.1
/!\ Hot reload only pertains to the renderer process. The main electron process is not able to be hot reloaded, only restarted.
/!\ Angular CLI & Electron Builder needs Node 14 or later to work correctly.
Clone this repository locally:
git clone https://github.com/CorentinLat/ref-backInstall dependencies with npm (used by Electron renderer process):
npm installInstall NodeJS dependencies with npm (used by Electron main process):
cd app/
npm installWhy two package.json ? This project follow Electron Builder two package.json structure in order to optimize final bundle and be still able to use Angular ng add feature.
- in a first terminal window ->
npm run angular:serve - in a second terminal window ->
npm run electron:serve
And Voila! You can launch the application in a local development environment with hot reload!
The application code is managed by src/electron/main.ts.
| Folder | Description |
|---|---|
| src/electron | Electron main process folder (NodeJS) |
| src/angular | Electron renderer process folder (Web / Angular) |
| Command | Description |
|---|---|
npm run angular:serve |
Starts the Angular Live Development Server (DEV mode) |
npm run electron:serve |
Starts the Electron application (DEV mode) |
npm run package |
Builds your application and creates an app consumable based on your operating system |
The application is optimised. Only /dist folder and NodeJS dependencies are included in the final bundle.