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

Add a note to README indicating that using electron-reloader in a static script avoids problems with transpiling main electron process

Open feljx opened this issue 5 years ago • 1 comments

My project is in Typescript so I do transpile the main process files. It didn't work when I added the try...catch in the main module before transpilation, but I was able to add a simple script like the following and that worked.

require('./application')
try {
    const options = {
        debug: true,
        ignore: [ 'src' ]
    }
    require('electron-reloader')(module, options)
} catch (err) {
    console.log(err)
}

I require the main module after transpilation and copy this wrapper script as a static asset for development mode only. A little node in the README could point users to this workaround.

feljx avatar Feb 27 '21 14:02 feljx

Thanks for the workaround

kidroca avatar Sep 30 '22 12:09 kidroca