Closed TimNZ closed 7 years ago
Would recommend using __dirname as your source of truth. Pretty sure mainModule is readonly
I will, though I still think this should be looked at as it technically a breaking change?
Touching electron-prebuilt-compile is super Danger Zone because it's 1:1 synced to Electron versions, so if we make a mistake, we effectively burn an Electron version completely. Sorry, too risky
@paulcbetts Fair enough.
Perhaps that needs to go into a Breaking Changes section in the README ?
require.main is obviously also affected, and at some point someone else has to want to do something tricky like me.
Can you make it the target initial script e.g. src/index.js, as standard Electron does?
This may very well belong in electron-prebuilt-compile but I have no idea about the chain of control.
I was porting from webpack based system and use process.mainModule for root app path determination. Though now no longer using webpack I could maybe switch to __dirname