feat: loadFile
This commit is contained in:
		
							parent
							
								
									0fb526481d
								
							
						
					
					
						commit
						636e6c38ea
					
				| 
						 | 
					@ -1,3 +1,4 @@
 | 
				
			||||||
 | 
					import { join } from 'path'
 | 
				
			||||||
import { app, BrowserWindow } from 'electron'
 | 
					import { app, BrowserWindow } from 'electron'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const WINDOWS: Record<string, BrowserWindow | null> = {
 | 
					const WINDOWS: Record<string, BrowserWindow | null> = {
 | 
				
			||||||
| 
						 | 
					@ -11,7 +12,7 @@ function mainWin() {
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (app.isPackaged) {
 | 
					  if (app.isPackaged) {
 | 
				
			||||||
    WINDOWS.main.loadFile('')
 | 
					    WINDOWS.main.loadFile(join(__dirname, '../react-ts/index.html'))
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    WINDOWS.main.loadURL(`http://127.0.0.1:${process.env.PORT}`)
 | 
					    WINDOWS.main.loadURL(`http://127.0.0.1:${process.env.PORT}`)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue