mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 23:04:06 +00:00
* WIP * Add LogTerminal * Modify server startup view * Add installView * Add basic welcome screen and dev server setup * nit * nit * nit * nit * nit
33 lines
841 B
TypeScript
33 lines
841 B
TypeScript
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]
|
|
})
|
|
) |