Reputation: 65
I am trying to convert my current code into a webpack js file. But I don't know how I can include a library on the remote variabel of Electron.
current code:
const { remote } = require('electron');
var windowManager = remote.require('electron-window-manager');
webpack file:
import {remote} from 'electron';
How do I import the windowManager on the remote import?
Upvotes: 0
Views: 899
Reputation: 998
Here's how:
1.In the main process
const windowManager = require('electron-window-manager');
global.winMgr = windowManager;
2.In The renderer process
const {getGlobal} = require('electron').remote;
const winMgr = getGlobal('winMgr');
Upvotes: 1