fix/ use node 3rd party libraries in renderer process
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user