fix: use VITE_DEV_SERVER_URL instead `app.isPackaged`
This commit is contained in:
		
							parent
							
								
									c711938f70
								
							
						
					
					
						commit
						a82f0828a8
					
				| 
						 | 
					@ -44,11 +44,12 @@ async function createWindow() {
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (app.isPackaged) {
 | 
					  if (process.env.VITE_DEV_SERVER_URL) { // electron-vite-vue#298
 | 
				
			||||||
    win.loadFile(indexHtml)
 | 
					 | 
				
			||||||
  } else {
 | 
					 | 
				
			||||||
    win.loadURL(url)
 | 
					    win.loadURL(url)
 | 
				
			||||||
    // win.webContents.openDevTools()
 | 
					    // Open devTool if the app is not packaged
 | 
				
			||||||
 | 
					    win.webContents.openDevTools()
 | 
				
			||||||
 | 
					  } else {
 | 
				
			||||||
 | 
					    win.loadFile(indexHtml)
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Test actively push message to the Electron-Renderer
 | 
					  // Test actively push message to the Electron-Renderer
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue