refactor: better scripts and vite-config
This commit is contained in:
1 parent
7aa3614676
commit
2fed75baf0
5 files changed
+53
-61
No files matched your search
@@ -27,14 +27,14 @@ async function createWindow() {
|
||||
if (app.isPackaged) {
|
||||
win.loadFile(join(__dirname, '../renderer/index.html'))
|
||||
} else {
|
||||
const pkg = await import('../../package.json')
|
||||
const url = `http://${pkg.env.HOST || '127.0.0.1'}:${pkg.env.PORT}`
|
||||
// 🚧 Use ['ENV_NAME'] avoid vite:define plugin
|
||||
const url = `http://${process.env['VITE_DEV_SERVER_HOST']}:${process.env['VITE_DEV_SERVER_PORT']}`
|
||||
|
||||
win.loadURL(url)
|
||||
win.webContents.openDevTools()
|
||||
}
|
||||
|
||||
// Test active push message to Renderer-process.
|
||||
// Test active push message to Renderer-process
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
win?.webContents.send('main-process-message', (new Date).toLocaleString())
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user