electron-vite-react
electron-vite-react copied to clipboard
How to setup auto reload the app when the files of main process are updated?
For example I'm using IPC, but when change an implementation of a method of the IPC, this change is not showed in real time like when do a change in the renderer, currently I do manually restart to see the changes in the app.
Example: https://github.com/MiniSuperDev/electron-vite-react-main-reload/tree/main
- Click this button
- Check the message
- Change the implementation in the main process
Change this:
https://github.com/MiniSuperDev/electron-vite-react-main-reload/blob/main/electron/main/index.ts#L123-L128
For this:
ipcMain.handle("getDate", () => {
return `Other String:` + `${Date.now()}`;
});
- Save and click the button again
You notice that the message is the previous.
- Restart the app to see the new implementation
I think it should restart the app, or do a hot reload if possible. Thanks