Files
vpp-maglev/cmd/frontend/web/vite.config.ts

26 lines
704 B
TypeScript

// SPDX-License-Identifier: Apache-2.0
import { defineConfig } from "vite";
import solid from "vite-plugin-solid";
// The app is served under /view/ by the Go binary (via http.StripPrefix),
// which means Vite must emit asset URLs rooted there. For local `npm run
// dev` outside the Go binary we also set server.base so the dev server
// serves at /view/ and proxies API calls through to a running frontend.
export default defineConfig({
base: "/view/",
plugins: [solid()],
build: {
outDir: "dist",
emptyOutDir: true,
target: "es2020",
},
server: {
port: 5173,
proxy: {
"/view/api": "http://localhost:8080",
"/admin": "http://localhost:8080",
},
},
});