initial commit
This commit is contained in:
commit
3e90445fab
20 changed files with 961 additions and 0 deletions
38
src/bun/index.ts
Normal file
38
src/bun/index.ts
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import { BrowserWindow, Updater } from "electrobun/bun";
|
||||
|
||||
const DEV_SERVER_PORT = 5173;
|
||||
const DEV_SERVER_URL = `http://localhost:${DEV_SERVER_PORT}/Dashboard`;
|
||||
|
||||
// Check if Vite dev server is running for HMR
|
||||
async function getMainViewUrl(): Promise<string> {
|
||||
const channel = await Updater.localInfo.channel();
|
||||
if (channel === "dev") {
|
||||
try {
|
||||
await fetch(DEV_SERVER_URL, { method: "HEAD" });
|
||||
console.log(`HMR enabled: Using Vite dev server at ${DEV_SERVER_URL}`);
|
||||
return DEV_SERVER_URL;
|
||||
} catch {
|
||||
console.log("Vite dev server not running. Run 'bun run dev:hmr' for HMR support.");
|
||||
}
|
||||
}
|
||||
return "views://mainview/index.html";
|
||||
}
|
||||
|
||||
// Create the main application window
|
||||
const url = await getMainViewUrl();
|
||||
|
||||
const mainWindow = new BrowserWindow({
|
||||
title: "GameFlow",
|
||||
url,
|
||||
styleMask: {
|
||||
Borderless: true,
|
||||
},
|
||||
frame: {
|
||||
width: 1280,
|
||||
height: 800,
|
||||
x: 200,
|
||||
y: 200,
|
||||
},
|
||||
});
|
||||
|
||||
console.log("React Tailwind Vite app started!");
|
||||
Loading…
Add table
Add a link
Reference in a new issue