Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sync code changes in electron app while developing

Are there any tools to live reload electron app when code is changed similar to browser-sync for web?

Whenever we change code for electron app, I am terminating existing running process and relaunching with electron . Are they any tools to reload electron app automatically when code is changed.

like image 307
Sathya Vikram Avatar asked Aug 31 '16 13:08

Sathya Vikram


People also ask

Does Nodemon work with Electron?

My personal favorite is nodemon because you can either use config file or pass something like this: nodemon --watch . --exec "electron ." And it will work just fine.

Does Electron support hot reload?

The electron does not provide any in-built hot reloading module however, we can still implement hot reloading capability using open-source packages. This tutorial will demonstrate how to implement hot reloading in Electron using electron-reload npm package and electron-reloader npm package.


2 Answers

In this case, you should take a look at development tools for NodeJS process management. My personal favorite is nodemon because you can either use config file or pass something like this:

nodemon --watch . --exec "electron ."

And it will work just fine. But again, it's my opinion, pick the right for you from the list.

like image 193
G07cha Avatar answered Oct 13 '22 19:10

G07cha


A little late answer but I hope it helps everyone.
There is an npm module called Electromon.

npm i -g electromon [install]

Usage would be electron .\main.js [change name of main.js to your files like app.js or something. ]

like image 42
Aham Ekakin Avatar answered Oct 13 '22 19:10

Aham Ekakin