Files
codecraft/web/vite.config.ts
T
Richard ZinkandClaude Opus 5.5 6dffcb501a Add terminal client, memory, model fallback, version and install improvements
- codecraft: full-screen terminal client (ratatui) – local tools and files,
  models via the CodeCraft server gateway or own providers (standalone with a
  guided setup), slash commands, @files, permission dialogs, resume, update
- Static Linux CLI builds (x86_64/aarch64, cargo-zigbuild) served by the
  server: /cli/install.sh and /cli/download/<target>
- Project memory (remember tool, .codecraft/memory.md) and personal memory
- Model fallback when a host is unreachable or a budget is used up
- Version/commit in UI and health, daily release check, "What's new" dialog
- PWA: install button, maskable icon, manifest id and screenshots
- Case-insensitive detection of connection errors for retries

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 00:13:06 +01:00

53 lines
1.9 KiB
TypeScript

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { VitePWA } from "vite-plugin-pwa";
const backend = process.env.CODECRAFT_BACKEND ?? "http://127.0.0.1:8787";
export default defineConfig({
plugins: [
react(),
VitePWA({
registerType: "autoUpdate",
includeAssets: ["icon.svg", "apple-touch-icon.png"],
manifest: {
name: "CodeCraft",
short_name: "CodeCraft",
description: "Web-based coding harness for AI models",
theme_color: "#282828",
background_color: "#282828",
display: "standalone",
start_url: "/",
id: "/",
scope: "/",
orientation: "any",
categories: ["developer", "productivity"],
icons: [
{ src: "icon-192.png", sizes: "192x192", type: "image/png" },
{ src: "icon-512.png", sizes: "512x512", type: "image/png" },
{ src: "icon-maskable-512.png", sizes: "512x512", type: "image/png", purpose: "maskable" },
{ src: "icon.svg", sizes: "any", type: "image/svg+xml" },
],
screenshots: [
{ src: "screenshots/wide.png", sizes: "1400x860", type: "image/png", form_factor: "wide", label: "Chat with an agent" },
{ src: "screenshots/narrow.png", sizes: "780x1688", type: "image/png", form_factor: "narrow", label: "CodeCraft on the phone" },
],
},
workbox: {
// The API is always live data; only the app shell is cached.
navigateFallbackDenylist: [/^\/api/, /^\/cli/],
runtimeCaching: [],
// The STEP importer (OpenCascade, ~8 MB) is loaded only when needed.
globIgnores: ["**/occt-import-js*"],
// Web Push handlers (push, notificationclick).
importScripts: ["push-sw.js"],
},
}),
],
server: {
proxy: {
"/api": { target: backend, ws: true, changeOrigin: true },
},
},
});