createWebHistory with base "/". The Go server already falls back to index.html for any unmatched path and [web] has no path-prefix option, so the dashboard is always at the root. legacy-hash-redirect.ts rewrites `#/path` links minted before this change. Verified against archie-ui rather than the Vite dev server: /tasks, /tasks/42 and /settings all serve index.html with assets resolving, and #/settings lands on /settings.
33 lines
840 B
TypeScript
33 lines
840 B
TypeScript
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
export default defineConfig({
|
|
plugins: [vue(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
"@": new URL("./src", import.meta.url).pathname,
|
|
},
|
|
},
|
|
base: "/",
|
|
build: {
|
|
outDir: "dist",
|
|
emptyOutDir: true,
|
|
rollupOptions: {
|
|
output: {
|
|
entryFileNames: "assets/[name].js",
|
|
chunkFileNames: "assets/[name].js",
|
|
assetFileNames: "assets/[name].[ext]",
|
|
},
|
|
},
|
|
},
|
|
server: {
|
|
// Proxies the API to a locally running archie-ui (the process that serves
|
|
// the dashboard) so the frontend can be developed without rebuilding Go.
|
|
proxy: {
|
|
"/api": "http://127.0.0.1:8484",
|
|
"/events": { target: "http://127.0.0.1:8484", ws: true },
|
|
},
|
|
},
|
|
});
|