4

I'm trying to integrate Electron into the Akveo's ng2-admin, and I already had webpack config files for the Angular app, as well the Electron platform, you can actually look the integration here.

What I'm trying now it's to get live reload capabilities. The scripts right now will package the electron application as build.

My idea it's to have couple scenarios that can be covered with npm scripts, like:

  • Live reload of the Angular application inside the Electron platform.
  • Live reload of the complete solution, with Electron live self reload.

Those two would work well, I think.

Thanks!

Michael Jota
  • 138
  • 8

1 Answers1

1

You can have a look to the my Angular 2 integration with Webpack and Electron here. The project is based on the Angular 2 tutorial. When using Electron in development mode (npm run start.desktop), webpack livereloads the code.

I also created a quickstart project: https://github.com/osechet/angular-webpack-quickstart

osechet
  • 426
  • 3
  • 11
  • This is my current implementation [angular2-ultimate-starter](https://github.com/michaeljota/angular2-ultimate-starter) It does the reload, but I can't reload only the render part when the webpack rebuilds it, have to reload the whole application. Does your solution only reload the renderer side when just the renderer files had change? – Michael Jota Nov 25 '16 at 13:02
  • @MichaelJota I tested and this does reload just the renderer when the browser app changes, and it restarts electron when the main process is updated. None of the other Electron/Angular2 boilerplates do this the right way. – Colin Skow Nov 27 '16 at 06:48
  • Yes, as @ColinSkow said, with this implementation, webpack watches the renderer files and the main files independently. If a renderer file changes, the electron window content is reloaded. If the main files are updated, the whole app is restarted. – osechet Nov 30 '16 at 12:40