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.
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.
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.
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.
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. ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With