turash/bugulma/frontend/vite.config.ts
Damir Mukimov 6347f42e20
Consolidate repositories: Remove nested frontend .git and merge into main repository
- Remove nested git repository from bugulma/frontend/.git
- Add all frontend files to main repository tracking
- Convert from separate frontend/backend repos to unified monorepo
- Preserve all frontend code and development history as tracked files
- Eliminate nested repository complexity for simpler development workflow

This creates a proper monorepo structure with frontend and backend
coexisting in the same repository for easier development and deployment.
2025-11-25 06:02:57 +01:00

51 lines
1.5 KiB
TypeScript

import react from '@vitejs/plugin-react';
import path from 'path';
import { defineConfig, loadEnv } from 'vite';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, '.', '');
const isProduction = mode === 'production';
return {
server: {
port: 3000,
host: '0.0.0.0',
// Force HTTPS in production builds
https: isProduction ? true : false,
proxy: {
'/auth': {
target: isProduction
? env.VITE_API_BASE_URL || 'https://api.bugulma.city'
: 'http://localhost:8080',
changeOrigin: true,
secure: isProduction, // Verify SSL certificates in production
},
'/api': {
target: isProduction
? env.VITE_API_BASE_URL || 'https://api.bugulma.city'
: 'http://localhost:8080',
changeOrigin: true,
secure: isProduction, // Verify SSL certificates in production
},
'/static': {
target: isProduction
? env.VITE_API_BASE_URL || 'https://api.bugulma.city'
: 'http://localhost:8080',
changeOrigin: true,
secure: isProduction, // Verify SSL certificates in production
},
},
},
plugins: [react()],
define: {
'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY),
},
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
},
},
};
});