open-swe/ui/vite.config.ts
Johannes du Plessis be2fe7131b
feat: live reviewer eval logs on a dedicated admin page (#1527)
* feat: stream reviewer eval logs on a dedicated admin page

Stream the eval subprocess output into a rolling log_tail and persist it
during the run (was only captured at exit), so the live output is visible
while the eval runs. Move the eval runner off the admin page onto its own
/admin/evals page (linked like Review Style Prompts) with a live log viewer.

* chore: drop unrelated SSR-register drift from generated route tree

* fix(ui): pre-bundle workbox-window to stop dev re-optimize reload

The PWA service worker (devOptions.enabled) pulls workbox-window, which
Vite discovers after first render and re-optimizes, forcing a reload that
cancels in-flight code-split route imports (Failed to fetch dynamically
imported module). Pre-bundling it via optimizeDeps.include avoids the
mid-session reload.

* fix(ui): suppress html hydration warning for pre-hydration theme script

The inline theme script sets class="dark"/color-scheme on <html> before
React hydrates, so the prerendered HTML never matches. suppressHydrationWarning
on <html> silences the (expected) one-level attribute mismatch.

---------

Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
2026-06-15 11:29:16 -07:00

67 lines
1.8 KiB
TypeScript

import { defineConfig } from "vite"
import { devtools } from "@tanstack/devtools-vite"
import { tanstackStart } from "@tanstack/react-start/plugin/vite"
import viteReact from "@vitejs/plugin-react"
import viteTsConfigPaths from "vite-tsconfig-paths"
import tailwindcss from "@tailwindcss/vite"
import { nitro } from "nitro/vite"
import { VitePWA } from "vite-plugin-pwa"
const config = defineConfig({
optimizeDeps: { include: ["workbox-window"] },
plugins: [
devtools(),
nitro(),
viteTsConfigPaths({
projects: ["./tsconfig.json"],
}),
tailwindcss(),
tanstackStart({ spa: { enabled: true } }),
VitePWA({
injectRegister: false,
registerType: "prompt",
outDir: ".output/public",
devOptions: {
enabled: true,
},
integration: {
closeBundleOrder: "pre",
},
manifest: {
id: "/",
name: "Open SWE",
short_name: "Open SWE",
description: "Open-source coding agents for Slack, Linear, and GitHub.",
start_url: "/",
scope: "/",
display: "standalone",
theme_color: "#000000",
background_color: "#ffffff",
icons: [
{
src: "/favicon.png",
sizes: "192x192",
type: "image/png",
},
{
src: "/logo512.png",
sizes: "512x512",
type: "image/png",
purpose: "any maskable",
},
],
},
workbox: {
navigateFallback: "/_shell.html",
navigateFallbackDenylist: [/^\/dashboard\/api\//, /^\/_serverFn\//],
globPatterns: ["**/*.{js,css,png,svg,ico,webmanifest}"],
additionalManifestEntries: [
{ url: "/_shell.html", revision: new Date().toISOString() },
],
},
}),
viteReact(),
],
})
export default config