Open aleclarson opened 8 years ago
Assuming I'm in the parent directory of the module I'm attempting to require...
require
devtool
Then type in the Console:
require('./my-module') // throws error: Cannot find module './my-module'
Since no __dirname exists in the Console, the relative require cannot be resolved by Electron.
__dirname
The workaround:
require(process.cwd() + '/my-module')
Assuming I'm in the parent directory of the module I'm attempting to
require
...Then type in the Console:
Since no
__dirname
exists in the Console, the relativerequire
cannot be resolved by Electron.The workaround: