mirror of
https://github.com/electron-vite/electron-vite-vue
synced 2025-01-31 12:06:40 +08:00
feat: hoist process.env
This commit is contained in:
parent
8a67ac6954
commit
a15028ad68
@ -1,3 +1,17 @@
|
||||
// The built directory structure
|
||||
//
|
||||
// ├─┬ dist
|
||||
// │ ├─┬ electron
|
||||
// │ │ ├─┬ main
|
||||
// │ │ │ └── index.js
|
||||
// │ │ └─┬ preload
|
||||
// │ │ └── index.js
|
||||
// │ ├── index.html
|
||||
// │ ├── ...other-static-files-from-public
|
||||
// │
|
||||
process.env.DIST = join(__dirname, '../..')
|
||||
process.env.PUBLIC = app.isPackaged ? process.env.DIST : join(process.env.DIST, '../public')
|
||||
|
||||
import { app, BrowserWindow, shell, ipcMain } from 'electron'
|
||||
import { release } from 'os'
|
||||
import { join } from 'path'
|
||||
@ -18,9 +32,6 @@ if (!app.requestSingleInstanceLock()) {
|
||||
// Read more on https://www.electronjs.org/docs/latest/tutorial/security
|
||||
// process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
|
||||
|
||||
process.env.DIST = join(__dirname, '../..')
|
||||
process.env.PUBLIC = app.isPackaged ? process.env.DIST : join(process.env.DIST, '../public')
|
||||
|
||||
let win: BrowserWindow | null = null
|
||||
// Here, you can also use other preload
|
||||
const preload = join(__dirname, '../preload/index.js')
|
||||
|
Loading…
x
Reference in New Issue
Block a user