更改本地dev常见端口
This commit is contained in:
@@ -51,6 +51,10 @@ function stripVantRemoteIconFont() {
|
||||
}
|
||||
}
|
||||
|
||||
const frontendPort = Number(process.env.DEV_FRONTEND_PORT || process.env.PORT || 5189)
|
||||
const backendPort = Number(process.env.DEV_BACKEND_PORT || 18088)
|
||||
const apiProxyTarget = process.env.VITE_API_PROXY_TARGET || `http://127.0.0.1:${backendPort}`
|
||||
|
||||
export default defineConfig({
|
||||
// 禁止 vite 清屏,避免把后端启动日志(GIN 路由、迁移等)从终端滚动缓冲里抹掉
|
||||
clearScreen: false,
|
||||
@@ -74,9 +78,10 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
port: frontendPort,
|
||||
strictPort: true,
|
||||
proxy: {
|
||||
'/api': 'http://127.0.0.1:8080',
|
||||
'/api': apiProxyTarget,
|
||||
},
|
||||
allowedHosts: [
|
||||
'221329.cc.cd',
|
||||
|
||||
Reference in New Issue
Block a user