feat: bumps electron@28, vite@5, vite-plugin-electron@0.28.0-beta.2

This commit is contained in:
草鞋没号 committed 2024-01-03 15:51:51 +08:00
1 parent 5303923340
commit 208ab386b1
12 files changed
+164 -54

No files matched your search

+10 -5
View File
@@ -1,15 +1,19 @@
import { app, BrowserWindow, shell, ipcMain } from 'electron'
import { release } from 'node:os'
import { join } from 'node:path'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { update } from './update'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
// The built directory structure
//
// ├─┬ dist-electron
// │ ├─┬ main
// │ │ └── index.js > Electron-Main
// │ └─┬ preload
// │ └── index.js > Preload-Scripts
// │ └── index.mjs > Preload-Scripts
// ├─┬ dist
// │ └── index.html > Electron-Renderer
//
@@ -37,7 +41,7 @@ if (!app.requestSingleInstanceLock()) {
let win: BrowserWindow | null = null
// Here, you can also use other preload
const preload = join(__dirname, '../preload/index.js')
const preload = join(__dirname, '../preload/index.mjs')
const url = process.env.VITE_DEV_SERVER_URL
const indexHtml = join(process.env.DIST, 'index.html')
@@ -48,10 +52,11 @@ async function createWindow() {
webPreferences: {
preload,
// Warning: Enable nodeIntegration and disable contextIsolation is not secure in production
// nodeIntegration: true,
// Consider using contextBridge.exposeInMainWorld
// Read more on https://www.electronjs.org/docs/latest/tutorial/context-isolation
nodeIntegration: true,
contextIsolation: false,
// contextIsolation: false,
},
})