electron-reload icon indicating copy to clipboard operation
electron-reload copied to clipboard

Hard resets not working with electron-forge

Open ToP29 opened this issue 6 years ago • 8 comments

I am trying to get hardresets to work with electron-forge, but to start electron-forge you need to execute electron-forge start. Since i can add only path to executable I am unable to use hard resets

I would need something like this:

require('electron-reload')(path.join(__dirname, '../app'), {
	electron: path.join(__dirname, '../node_modules', '.bin', 'electron-forge start')
})

ToP29 avatar Jul 06 '18 11:07 ToP29

So you want some option to restart electron through electron-forge?

yan-foto avatar Jul 06 '18 11:07 yan-foto

Yop :)

ToP29 avatar Jul 06 '18 15:07 ToP29

So one idea would be to enhance options so you could spawn any process and not only electron. Care to submit a pull request?

yan-foto avatar Jul 06 '18 15:07 yan-foto

I would like to, but I don'n know how :/ I am kinda new at this stuff

ToP29 avatar Jul 06 '18 17:07 ToP29

I think this is a bug, not an enhancement. createWatcher applies ignored: ignoredPaths to to both watchers. In the case of the hardWatcher, this results in chokidar ignoring changes to the mainFile.

steeltomato avatar Mar 11 '19 15:03 steeltomato

@steeltomato Good point, but wrong thread?

yan-foto avatar Mar 11 '19 15:03 yan-foto

Is there any updates on this? Do we have any compatibility with electron-forge yet? I can try and submit a PR if there isn't.

gbrunow avatar Nov 29 '21 22:11 gbrunow

This is probably wrong, but I think I had this same problem:

The electron forge app would 'crash' when editing main.js and not recover...

require('electron-reload')(__dirname, {
    electron: path.join(__dirname, 'node_modules', '.bin', 'electron-forge'),
    electronArgv: ['start'],
    hardResetMethod: 'exit',
    awaitWriteFinish: true
})

It solved the problem for me, not sure if relevant to this issue though.

dreams-and-thoughts avatar Jul 26 '22 02:07 dreams-and-thoughts