feat: hoist `process.env`
This commit is contained in:
		
							parent
							
								
									cac23a138c
								
							
						
					
					
						commit
						b2a073cc8d
					
				| 
						 | 
					@ -1,3 +1,18 @@
 | 
				
			||||||
 | 
					// 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')
 | 
				
			||||||
 | 
					process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { app, BrowserWindow, shell, ipcMain } from 'electron'
 | 
					import { app, BrowserWindow, shell, ipcMain } from 'electron'
 | 
				
			||||||
import { release } from 'os'
 | 
					import { release } from 'os'
 | 
				
			||||||
import { join } from 'path'
 | 
					import { join } from 'path'
 | 
				
			||||||
| 
						 | 
					@ -13,10 +28,6 @@ if (!app.requestSingleInstanceLock()) {
 | 
				
			||||||
  process.exit(0)
 | 
					  process.exit(0)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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
 | 
					let win: BrowserWindow | null = null
 | 
				
			||||||
// Here, you can also use other preload
 | 
					// Here, you can also use other preload
 | 
				
			||||||
const preload = join(__dirname, '../preload/index.js')
 | 
					const preload = join(__dirname, '../preload/index.js')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue