electron-userland / electron-compile

DEPRECATED: Electron supporting package to compile JS and CSS in Electron applications
1.01k stars 97 forks source link

process.mainModule = /electron-prebuilt-compile/lib/es6-init.js #191

Closed TimNZ closed 7 years ago

TimNZ commented 7 years ago

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

MarshallOfSound commented 7 years ago

Would recommend using __dirname as your source of truth. Pretty sure mainModule is readonly

TimNZ commented 7 years ago

I will, though I still think this should be looked at as it technically a breaking change?

anaisbetts commented 7 years ago

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

TimNZ commented 7 years ago

@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.