mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 11:11:53 +00:00
[Electron] Add basic welcome screen (#1491)
* WIP * Add LogTerminal * Modify server startup view * Add installView * Add basic welcome screen and dev server setup * nit * nit * nit * nit * nit
This commit is contained in:
33
vite.electron.config.mts
Normal file
33
vite.electron.config.mts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { defineConfig, Plugin } from 'vite'
|
||||
import { mergeConfig } from 'vite'
|
||||
import type { UserConfig } from 'vitest/config'
|
||||
import baseConfig from './vite.config.mts'
|
||||
import type { ElectronAPI } from '@comfyorg/comfyui-electron-types'
|
||||
|
||||
const electronAPIMock: Partial<ElectronAPI> = {
|
||||
sendReady: () => {},
|
||||
onShowSelectDirectory: () => {},
|
||||
onFirstTimeSetupComplete: () => {},
|
||||
onProgressUpdate: () => {},
|
||||
onLogMessage: () => {},
|
||||
isFirstTimeSetup: () => Promise.resolve(true)
|
||||
}
|
||||
|
||||
const mockElectronAPI: Plugin = {
|
||||
name: 'mock-electron-api',
|
||||
transformIndexHtml() {
|
||||
return [
|
||||
{
|
||||
tag: 'script',
|
||||
children: `window.electronAPI = ${JSON.stringify(electronAPIMock)};`
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
export default mergeConfig(
|
||||
baseConfig as unknown as UserConfig,
|
||||
defineConfig({
|
||||
plugins: [mockElectronAPI]
|
||||
})
|
||||
)
|
||||
Reference in New Issue
Block a user