fix(🐞): load path

This commit is contained in:
草鞋没号 2022-06-16 19:51:59 +08:00
parent d6f1bdc9ab
commit 5387510adc
2 changed files with 3 additions and 3 deletions

View File

@ -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()

View File

@ -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,