41 lines
910 B
TypeScript
41 lines
910 B
TypeScript
import { defineConfig, loadEnv } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import path from "path";
|
|
|
|
/// <reference types="vitest" />
|
|
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd(), "");
|
|
const apiProxyTarget = env.VITE_API_PROXY_TARGET || "http://localhost:8090";
|
|
|
|
return {
|
|
plugins: [react(), tailwindcss()],
|
|
worker: {
|
|
format: "es",
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
server: {
|
|
host: "0.0.0.0",
|
|
allowedHosts: ["silo.local"],
|
|
proxy: {
|
|
"/api": {
|
|
target: apiProxyTarget,
|
|
changeOrigin: true,
|
|
secure: true,
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
test: {
|
|
environment: "jsdom",
|
|
globals: true,
|
|
setupFiles: ["./src/test-setup.ts"],
|
|
},
|
|
};
|
|
});
|