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,