codeburn/dash/vite.config.ts
Resham Joshi 2d44aeaedb
feat(web): local React dashboard served by codeburn web (#531)
Add a Vite + React 19 + Tailwind v4 + Recharts SPA (dash/) and a 'web'
command that serves the built UI plus a local /api/usage endpoint backed
by the existing menubar aggregation. Midnight theme with CodeBurn's
orange chart ramp: hero cost, a stacked-by-model daily bar chart with a
custom tooltip and hover-dim, metric cards, by-tool and by-activity bar
lists, and top-projects and tools tables. Period and provider filters,
react-query with skeleton loading. Stays 100% local.

build:dash builds the SPA into dist/dash (shipped via package files,
served at runtime); a missing build falls back to a helpful message.
2026-06-20 16:21:25 +02:00

25 lines
855 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import { fileURLToPath, URL } from 'node:url'
// base './' so the built assets load with relative URLs when the CLI serves
// dist/dash from the local server root. Built output goes straight into the
// package's dist/dash so `codeburn web` can serve it after `npm run build`.
export default defineConfig({
plugins: [react(), tailwindcss()],
base: './',
resolve: {
alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) },
},
build: {
outDir: '../dist/dash',
emptyOutDir: true,
},
server: {
port: 5173,
// During frontend dev, run `codeburn web` (CLI api on 4747) and `npm run dev`
// here; this proxies the data calls to the CLI.
proxy: { '/api': 'http://127.0.0.1:4747' },
},
})