From 5387510adcd0d29601486bf457cca06e05416a56 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: Thu, 16 Jun 2022 19:51:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(=F0=9F=90=9E):=20load=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/main/index.ts | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index 8818fa3..76cf34d 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 splash = join(__dirname, '../electron-preload/splash.js') +const splash = join(__dirname, '../preload/splash.js') // 🚧 Use ['ENV_NAME'] avoid vite:define plugin const url = `http://${process.env['VITE_DEV_SERVER_HOST']}:${process.env['VITE_DEV_SERVER_PORT']}` @@ -31,7 +31,7 @@ async function createWindow() { }) if (app.isPackaged) { - win.loadFile(join(__dirname, '../index.html')) + win.loadFile(join(__dirname, '../../index.html')) } else { win.loadURL(url) // win.webContents.openDevTools() diff --git a/package.json b/package.json index 70502f1..fac2998 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "electron-vue-vite", "version": "2.0.0", - "main": "dist/electron-main/index.js", + "main": "dist/electron/main/index.js", "author": "草鞋没号 <308487730@qq.com>", "license": "MIT", "private": true,