Add environment configuration example, update .gitignore for additional files, and refactor Vite config to load environment variables. Remove obsolete settings and backup files.

This commit is contained in:
Simos
2025-07-04 20:18:25 +02:00
parent 3b0a612c9c
commit 83d3f8da13
7 changed files with 100 additions and 209 deletions

View File

@@ -1,19 +1,25 @@
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
server: {
port: process.env.VITE_PORT || 3001,
proxy: {
'/api': `http://localhost:${process.env.PORT || 3002}`,
'/ws': {
target: `ws://localhost:${process.env.PORT || 3002}`,
ws: true
export default defineConfig(({ command, mode }) => {
// Load env file based on `mode` in the current working directory.
const env = loadEnv(mode, process.cwd(), '')
return {
plugins: [react()],
server: {
port: parseInt(env.VITE_PORT) || 3001,
proxy: {
'/api': `http://localhost:${env.PORT || 3002}`,
'/ws': {
target: `ws://localhost:${env.PORT || 3002}`,
ws: true
}
}
},
build: {
outDir: 'dist'
}
},
build: {
outDir: 'dist'
}
})