继续提交
This commit is contained in:
@@ -1,12 +1,29 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
|
||||
base: './', // Ensure relative paths for assets
|
||||
server: {
|
||||
host: '0.0.0.0', // 监听所有网络接口(包括局域网)
|
||||
port: 5173, // 端口号(可选,默认5173)
|
||||
proxy: {
|
||||
// 开发环境代理配置
|
||||
'/api': {
|
||||
target: 'http://192.168.1.233:2424',
|
||||
changeOrigin: true,
|
||||
}
|
||||
}
|
||||
},
|
||||
preview: {
|
||||
host: '0.0.0.0',
|
||||
port: 4173,
|
||||
proxy: {
|
||||
// 预览环境代理配置(npm run preview)
|
||||
'/api': {
|
||||
target: 'http://192.168.1.233:2424',
|
||||
changeOrigin: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user