Files
llama-swap/ui-svelte/vite.config.ts
Claude f0144a2361 ui: add shadcn-svelte foundation and theming
Set up shadcn-svelte components and adopt its design-token system as the
base for modernizing the UI. Switch dark mode from the data-theme attribute
to the .dark class so shadcn primitives theme correctly.

- add components.json, $lib alias (tsconfig + vite), cn() util
- install shadcn primitives under src/lib/components/ui
- rewrite index.css with shadcn tokens (zinc + brand teal accent)
- keep legacy utility/class aliases as a transitional shim
- toggle .dark class from theme store in App.svelte

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UmuGqwNBJNEAMaWsdCDqUC
2026-06-27 11:42:43 +00:00

47 lines
1.1 KiB
TypeScript

import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import tailwindcss from "@tailwindcss/vite";
import { compression } from "vite-plugin-compression2";
import path from "node:path";
// https://vite.dev/config/
export default defineConfig({
plugins: [
svelte(),
tailwindcss(),
compression({
algorithm: "gzip",
exclude: [/\.(br)$/, /\.(gz)$/],
threshold: 1024,
}),
compression({
algorithm: "brotliCompress",
exclude: [/\.(br)$/, /\.(gz)$/],
threshold: 1024,
filename: "[path][base].br",
}),
],
base: "/ui/",
resolve: {
alias: {
$lib: path.resolve(__dirname, "./src/lib"),
},
},
build: {
outDir: "../internal/server/ui_dist",
assetsDir: "assets",
},
server: {
// yes very insecure but who's running this thing
// on the public internet for dev?! haha.
host: "0.0.0.0",
allowedHosts: true,
proxy: Object.fromEntries(
["/api", "/logs", "/upstream", "/unload", "/v1", "/sdapi"].map((path) => [
path,
process.env.LLAMA_SWAP_URL ?? "http://localhost:8080",
]),
),
},
});