Browse Source

refactor: use process type specific electron imports in default_app (#32097)

Milan Burda 3 years ago
parent
commit
77287febf4
3 changed files with 4 additions and 3 deletions
  1. 2 1
      default_app/default_app.ts
  2. 1 1
      default_app/main.ts
  3. 1 1
      default_app/preload.ts

+ 2 - 1
default_app/default_app.ts

@@ -1,4 +1,5 @@
-import { app, dialog, BrowserWindow, shell, ipcMain } from 'electron';
+import { shell } from 'electron/common';
+import { app, dialog, BrowserWindow, ipcMain } from 'electron/main';
 import * as path from 'path';
 import * as url from 'url';
 

+ 1 - 1
default_app/main.ts

@@ -1,4 +1,4 @@
-import * as electron from 'electron';
+import * as electron from 'electron/main';
 
 import * as fs from 'fs';
 import * as path from 'path';

+ 1 - 1
default_app/preload.ts

@@ -1,4 +1,4 @@
-import { ipcRenderer, contextBridge } from 'electron';
+import { ipcRenderer, contextBridge } from 'electron/renderer';
 
 const policy = window.trustedTypes.createPolicy('electron-default-app', {
   // we trust the SVG contents