MCPcopy Create free account
hub / github.com/TanStack/db / createWindow

Function createWindow

examples/electron/offline-first/electron/main.ts:78–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76})
77
78function createWindow() {
79 const preloadPath = path.join(__dirname, 'preload.cjs')
80
81 const win = new BrowserWindow({
82 width: 800,
83 height: 600,
84 webPreferences: {
85 contextIsolation: true,
86 nodeIntegration: false,
87 preload: preloadPath,
88 },
89 })
90
91 // Dev: load Vite dev server. Prod: load built files.
92 if (process.env.NODE_ENV !== 'production') {
93 win.loadURL('http://localhost:5173')
94 } else {
95 win.loadFile(path.join(__dirname, '..', 'dist', 'index.html'))
96 }
97}
98
99app.whenReady().then(() => {
100 // Add a menu with "New Window" so cross-window sync can be tested.

Callers 1

main.tsFile · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected