mirror of
https://github.com/MeshCore-Beacon/beacon-web.git
synced 2026-09-17 02:34:18 +00:00
34 lines
949 B
TypeScript
34 lines
949 B
TypeScript
/// <reference types="vitest/config" />
|
|
import { defineConfig, loadEnv } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), "VITE_");
|
|
// set VITE_DEV_PROXY to point at a running tower-server instance
|
|
const proxyTarget = env.VITE_DEV_PROXY;
|
|
|
|
return {
|
|
plugins: [react(), tailwindcss()],
|
|
server: proxyTarget
|
|
? {
|
|
proxy: {
|
|
"/api": { target: proxyTarget, changeOrigin: true, secure: true },
|
|
"/ws": {
|
|
target: proxyTarget.replace(/^http/, "ws"),
|
|
changeOrigin: true,
|
|
secure: true,
|
|
ws: true,
|
|
headers: { Origin: proxyTarget },
|
|
},
|
|
},
|
|
}
|
|
: undefined,
|
|
test: {
|
|
globals: true,
|
|
environment: "jsdom",
|
|
setupFiles: "./tests/setup.ts",
|
|
},
|
|
};
|
|
});
|