Harden local setup and development startup

This commit is contained in:
2026-07-25 17:14:19 -06:00
parent e8d2435cc2
commit feaa882fc3
10 changed files with 221 additions and 46 deletions
+10 -4
View File
@@ -1,19 +1,25 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import path from "node:path";
import { fileURLToPath, URL } from "node:url";
const srcDir = fileURLToPath(new URL("./src", import.meta.url));
const apiTarget = process.env.API_URL || "http://127.0.0.1:3000";
const webPort = Number(process.env.VITE_PORT) || 5173;
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
"@": srcDir,
},
},
server: {
port: 5173,
host: process.env.VITE_HOST || "127.0.0.1",
port: webPort,
strictPort: true,
proxy: {
"/api": {
target: "http://localhost:3000",
target: apiTarget,
changeOrigin: true,
},
},