feat(electron): move preload to infra (#3011)

This commit is contained in:
Alex Yang
2023-07-05 00:43:30 +08:00
committed by GitHub
parent 24be73ef63
commit dfbec46ded
20 changed files with 372 additions and 188 deletions
+4 -2
View File
@@ -1,8 +1,10 @@
import { contextBridge, ipcRenderer } from 'electron';
(async () => {
const { appInfo, getAffineAPIs } = await import('./affine-apis');
const { apis, events } = getAffineAPIs();
const { appInfo, getElectronAPIs } = await import(
'@toeverything/infra/preload/electron'
);
const { apis, events } = getElectronAPIs();
contextBridge.exposeInMainWorld('appInfo', appInfo);
contextBridge.exposeInMainWorld('apis', apis);