Files
x-server-mobile/frontend/vite.config.ts
T
浅念 baa424c841 feat: add used-car module and fix API response handling
- Add used-car pages: list, detail, create, edit, mine
- Add CarCard and PriceModal components
- Fix API response interceptor to accept both code 200 and 0
- Fix detail page: was incorrectly using edit page template
- Fix edit page: remove res.code check after API call
- Add image URL processing (localhost → localhost:8787)
- Add i18n translations for used-car module in 5 languages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 16:11:49 +08:00

40 lines
819 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
port: 5173,
host: '0.0.0.0',
strictPort: false,
// 允许公网域名访问
allowedHosts: [
'xsm.dev.hnxinyouhe.com',
'.dev.hnxinyouhe.com', // 允许所有 dev.hnxinyouhe.com 的子域名
'localhost',
'127.0.0.1'
],
proxy: {
'/api': {
target: 'http://127.0.0.1:8787',
changeOrigin: true,
},
'/uploads': {
target: 'http://127.0.0.1:8787',
changeOrigin: true,
},
},
},
build: {
outDir: 'dist',
sourcemap: true,
},
})