Hot-reloading the Electron app?

Hey @everyone,

I use electron-reload module, It is fast and one just have to save the file and it will reload the changes in seconds wihtout closing/opening the electron app

We just have to install electron-reload by this command

npm install electron-reload

And adding this one line to our electron main.js

require('electron-reload')(__dirname);

This is the literally easiest way to reload it everytime we save file.
And if your code contains error then it will show the errors first and exit so can make changes before restarting it.

For me This is life saver
You can read more about it here


2 Likes