30 lines
572 B
TypeScript
30 lines
572 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
const apiTarget = process.env.VITE_API_PROXY_TARGET || 'http://localhost:3000'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
port: 5173,
|
|
host: '0.0.0.0',
|
|
proxy: {
|
|
'/api': {
|
|
target: apiTarget,
|
|
changeOrigin: true,
|
|
},
|
|
'/socket.io': {
|
|
target: apiTarget,
|
|
changeOrigin: true,
|
|
ws: true,
|
|
},
|
|
},
|
|
},
|
|
css: {
|
|
modules: {
|
|
localsConvention: 'camelCase',
|
|
},
|
|
},
|
|
})
|