UPDATE/FIX: Configure frontend-dev proxy

This commit is contained in:
Chris-1010
2025-03-02 00:23:26 +00:00
parent 028e618830
commit 9718acb031

View File

@@ -1,34 +1,48 @@
import { defineConfig } from 'vite' import { defineConfig } from "vite";
import react from '@vitejs/plugin-react' import react from "@vitejs/plugin-react";
export default defineConfig({ export default defineConfig({
plugins: [react({ plugins: [
react({
// Add development-specific React plugin options // Add development-specific React plugin options
jsxRuntime: 'automatic' jsxRuntime: "automatic",
})], }),
],
server: { server: {
port: 5173, port: 5173,
proxy: { proxy: {
'/api': { "/api": {
target: 'http://localhost:8080', target: "http://localhost:8080",
changeOrigin: true, changeOrigin: true,
secure: false secure: false,
}, },
'/socket.io': { "/socket.io": {
target: 'http://localhost:8080', target: "http://localhost:8080",
changeOrigin: true, changeOrigin: true,
ws: true ws: true,
} },
} "/stream": {
target: "http://localhost:8080",
changeOrigin: true,
},
"/images": {
target: "http://localhost:8080",
changeOrigin: true,
},
"/user": {
target: "http://localhost:8080",
changeOrigin: true,
},
},
}, },
build: { build: {
sourcemap: true, sourcemap: true,
outDir: 'dist' outDir: "dist",
}, },
optimizeDeps: { optimizeDeps: {
exclude: ['@vite/client', '@vite/env'] exclude: ["@vite/client", "@vite/env"],
}, },
esbuild: { esbuild: {
logOverride: { 'this-is-undefined-in-esm': 'silent' } logOverride: { "this-is-undefined-in-esm": "silent" },
} },
}) });