Init node proj.
This commit is contained in:
25
main/main.js
Normal file
25
main/main.js
Normal file
@ -0,0 +1,25 @@
|
||||
const { app, BrowserWindow } = require('electron')
|
||||
const path = require('path')
|
||||
|
||||
let mainWindow
|
||||
|
||||
function createWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 300,
|
||||
height: 300,
|
||||
transparent: true,
|
||||
frame: false,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, '../renderer/src/preload.js'),
|
||||
contextIsolation: true
|
||||
}
|
||||
})
|
||||
|
||||
mainWindow.loadURL(
|
||||
process.env.NODE_ENV === 'development'
|
||||
? 'http://localhost:5173'
|
||||
: `file://${path.join(__dirname, '../renderer/dist/index.html')}`
|
||||
)
|
||||
}
|
||||
|
||||
app.whenReady().then(createWindow)
|
Reference in New Issue
Block a user