Auto-reload electron with nodemon

This commit is contained in:
Geomitron
2020-03-05 18:47:37 -05:00
parent 5ac5214a73
commit d7659554cc
3 changed files with 457 additions and 13 deletions

View File

@@ -82,7 +82,7 @@ function createBridgeWindow() {
mainWindow.loadURL(getLoadUrl())
if (isDevBuild) {
setUpDevTools()
mainWindow.webContents.openDevTools()
}
mainWindow.on('closed', () => {
@@ -123,17 +123,6 @@ function getLoadUrl() {
})
}
/**
* Automatically reload the electron process on changes, and open the dev tools
*/
function setUpDevTools() {
require('electron-reload')(__dirname, {
electron: require(`${__dirname}/../../node_modules/electron`)
})
mainWindow.webContents.openDevTools()
}
export function emitIPCEvent<E extends keyof IPCEmitEvents>(event: E, data: IPCEmitEvents[E]) {
mainWindow.webContents.send(event, data)
}