Files
punktfunk-plugin-rom-manager/ui/vite.config.ts
T
enricobuehler 8856df7e8d feat(ui): scaffold the blueprint SPA — vite 7 + tailwind 4 + kit theme
New workspace member built on @unom/ui 0.9.1 + @unom/app-ui 0.2.0 +
@punktfunk/plugin-kit/react, effect 4.0.0-beta.99 exact. base:'./' with
build straight into ../plugin/dist/ui; :5599 dev server proxies /api to
the plugin dev API only in live mode. styles.css = tailwind + tw-animate
+ the kit's violet theme (NOT @unom/ui's own neutral palette) + bare-dir
@source globs over the design-system dist.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 19:41:20 +02:00

37 lines
1.1 KiB
TypeScript

// Vite config for the plugin SPA. `base: "./"` because the console serves the built
// bundle from /plugin-ui/<id>/ — asset URLs must stay relative to survive the proxy.
// Dev has two modes (see src/mocks/): plain `bun run dev` runs entirely on fixtures,
// `bun run dev:live` proxies /api to the plugin's dev server (plugin/src/dev.ts, :5885).
import { fileURLToPath } from "node:url";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
export default defineConfig({
base: "./",
plugins: [react(), tailwindcss()],
resolve: {
alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) },
},
// Scan only the app entry — without this the dev dep-scanner also crawls any
// storybook-static/ build output sitting in the workspace and errors out.
optimizeDeps: { entries: ["index.html"] },
build: {
outDir: "../plugin/dist/ui",
emptyOutDir: true,
},
server: {
port: 5599,
...(process.env.VITE_API_MODE === "live"
? {
proxy: {
"/api": {
target: process.env.ROM_MANAGER_URL ?? "http://127.0.0.1:5885",
},
},
}
: {}),
},
});