From f094cbac34205e199a34d64cb150e62af6172176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7?= <308487730@qq.com> Date: Wed, 29 Jun 2022 07:33:37 +0800 Subject: [PATCH] chore: rename --- electron/main/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index e130720..5df8c29 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -16,7 +16,7 @@ process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true' let win: BrowserWindow | null = null // Here, you can also use other preload -const index = join(__dirname, '../preload/index.js') +const preload = join(__dirname, '../preload/index.js') // 🚧 Use ['ENV_NAME'] avoid vite:define plugin const url = `http://${process.env['VITE_DEV_SERVER_HOST']}:${process.env['VITE_DEV_SERVER_PORT']}` @@ -24,7 +24,7 @@ async function createWindow() { win = new BrowserWindow({ title: 'Main window', webPreferences: { - preload: index, + preload, nodeIntegration: true, contextIsolation: false, }, @@ -77,7 +77,7 @@ app.on('activate', () => { ipcMain.handle("open-win", (event, arg) => { const childWindow = new BrowserWindow({ webPreferences: { - preload: index, + preload, }, })