import { defineConfig, loadEnv } from 'vite' import vue from '@vitejs/plugin-vue' import path from 'path' export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), '') return { plugins: [vue()], server: { host: '0.0.0.0', port: 5173, proxy: { '/api/chat': { target: env.VITE_API_BASE_URL || 'https://thinkflow.lz-t.top', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/chat/, '/chat/completions') }, '/api/image': { target: env.VITE_API_BASE_URL || 'https://thinkflow.lz-t.top', changeOrigin: true, rewrite: (path) => path.replace(/^\/api\/image/, '/images/generations') } } }, resolve: { alias: { '@': path.resolve(__dirname, './src'), }, }, } })