mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
- Remove default localhost:8080 fallback from API_BASE_URL - Make VITE_API_URL required for proper functionality - Update .env.example to clarify required configuration - Ensure no hardcoded ports exist in frontend
41 lines
861 B
TypeScript
41 lines
861 B
TypeScript
import path from 'path'
|
|
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
export default defineConfig({
|
|
envDir: path.resolve(__dirname, '..'),
|
|
plugins: [
|
|
react(),
|
|
tailwindcss(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
},
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 5173,
|
|
proxy: process.env.VITE_API_URL ? {
|
|
'/api': {
|
|
target: process.env.VITE_API_URL,
|
|
changeOrigin: true,
|
|
},
|
|
} : undefined,
|
|
},
|
|
build: {
|
|
assetsInlineLimit: 4096,
|
|
rollupOptions: {
|
|
output: {
|
|
assetFileNames: (assetInfo) => {
|
|
if (assetInfo.name === 'manifest.json') {
|
|
return 'manifest.json';
|
|
}
|
|
return 'assets/[name]-[hash][extname]';
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|