fix/ use node 3rd party libraries in renderer process

This commit is contained in:
Maxime GRIS
2021-06-19 17:05:30 +02:00
parent 2e292321c5
commit 1fb08a7457
11 changed files with 1172 additions and 764 deletions

View File

@@ -27,12 +27,13 @@ export class ElectronService {
this.ipcRenderer = window.require('electron').ipcRenderer;
this.webFrame = window.require('electron').webFrame;
// If you want to use remote object in renderer process, please set enableRemoteModule to true in main.ts
// this.remote = window.require('@electron/remote');
// console.log('remote - globalShortcut', this.remote.globalShortcut);
this.childProcess = window.require('child_process');
this.fs = window.require('fs');
// If you want to use a NodeJS 3rd party deps in Renderer process (like @electron/remote), it must be declared in dependencies of both package.json (in root and app folders)
// If you want to use remote object in renderer process, please set enableRemoteModule to true in main.ts
this.remote = window.require('@electron/remote');
console.log('remote - globalShortcut', this.remote.globalShortcut);
}
}
}