It's easy to make a hot reload for webpage in electron BrowserWindow, But what about the main process? every time I change some event handler code in the main process, I need to restart electron to make the code take effect, any method to solve this problem without restarting the electron process?
There is not. Electron's main process is node.js, which doesn't support reload modules from its cache out of the box. Unless node.js have support for it, Electron will inherit same behavior.