Initialisation du projet : Electron + Vite + React + TypeScript, Vitest, CI Windows
Some checks are pending
CI / windows (push) Waiting to run
Some checks are pending
CI / windows (push) Waiting to run
This commit is contained in:
commit
afb305b3e8
15 changed files with 6166 additions and 0 deletions
26
src/main/index.ts
Normal file
26
src/main/index.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { join } from 'node:path'
|
||||
import { app, BrowserWindow } from 'electron'
|
||||
|
||||
function createWindow(): BrowserWindow {
|
||||
const win = new BrowserWindow({
|
||||
width: 1600,
|
||||
height: 900,
|
||||
fullscreen: !process.env.ELECTRON_RENDERER_URL,
|
||||
backgroundColor: '#0a0a0a',
|
||||
autoHideMenuBar: true,
|
||||
show: false,
|
||||
webPreferences: {
|
||||
preload: join(__dirname, '../preload/index.js'),
|
||||
contextIsolation: true,
|
||||
nodeIntegration: false,
|
||||
sandbox: true
|
||||
}
|
||||
})
|
||||
win.once('ready-to-show', () => win.show())
|
||||
if (process.env.ELECTRON_RENDERER_URL) win.loadURL(process.env.ELECTRON_RENDERER_URL)
|
||||
else win.loadFile(join(__dirname, '../renderer/index.html'))
|
||||
return win
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow)
|
||||
app.on('window-all-closed', () => app.quit())
|
||||
Loading…
Add table
Add a link
Reference in a new issue