mirror of
https://gitcode.com/JianFeeeee/webui4frpc.git
synced 2026-09-20 00:47:57 +00:00
原指向 127.0.0.1:17650 与后端默认 -addr 127.0.0.1:7500 不符;同步 @types/node devDependency 并纳入 tsconfig
32 lines
777 B
TypeScript
32 lines
777 B
TypeScript
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
// Backend default port (cmd/webui4frpc -addr). Override with VITE_PROXY_TARGET.
|
|
const backend = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7500";
|
|
|
|
// The frontend is served by the Go binary at / (embedded dist), and talks to
|
|
// the same origin via /api/manager/*.
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
base: "/",
|
|
resolve: {
|
|
alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) },
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: `@use "@/styles/variables.scss" as *;`,
|
|
},
|
|
},
|
|
},
|
|
build: {
|
|
outDir: "dist",
|
|
},
|
|
server: {
|
|
proxy: {
|
|
"/api": backend,
|
|
},
|
|
},
|
|
});
|