Module | Version | Size | File |
---|
require
starting from your application's main entry point.
It appears that this BrowserWindow
was created with
nodeIntegration
set to false
.
Devtron accesses Electron APIs via require
so you will
need to expose require
and process
via a
preload script in order to use Devtron.
You can specify a preload script to the BrowserWindow
constructor:
var window = new BrowserWindow({
webPreferences: {
preload: path.join(__dirname, 'preload.js')
}
})
Then add the following to the preload.js
script:
window.__devtron = {require: require, process: process}
You may want to guard the previous code block with a NODE_ENV
check so that these variables are only exposed during development:
if (process.env.NODE_ENV === 'development')
Restart your application once you've configured this preload script and Devtron should then be enabled for your app.