Add the Vite frontend, Express API server, and supporting configuration files so the app can run locally on a complete development stack. Made-with: Cursor
35 lines
929 B
TypeScript
35 lines
929 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react-swc";
|
|
import path from "path";
|
|
import { componentTagger } from "lovable-tagger";
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(({ mode }) => ({
|
|
server: {
|
|
// 127.0.0.1 avoids IPv6/Windows localhost quirks; 5173 avoids common 8080 conflicts (Docker, other apps).
|
|
host: "127.0.0.1",
|
|
port: 5173,
|
|
strictPort: false,
|
|
hmr: {
|
|
overlay: false,
|
|
},
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://127.0.0.1:3001",
|
|
changeOrigin: true,
|
|
},
|
|
"/uploads": {
|
|
target: "http://127.0.0.1:3001",
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
plugins: [react(), mode === "development" && componentTagger()].filter(Boolean),
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
dedupe: ["react", "react-dom", "react/jsx-runtime", "react/jsx-dev-runtime"],
|
|
},
|
|
}));
|