devtool
devtool copied to clipboard
Relative `require` paths do not work in the Console
Assuming I'm in the parent directory of the module I'm attempting to 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.
The workaround:
require(process.cwd() + '/my-module')