hookehuyr

docs: 更新环境配置文件中关于Vite端口的注释

将 .env.test 和 .env.development 中关于本地开发服务器端口的注释明确为“对应 Vite 默认开发端口 5173”,并在 vite.config.js 中补充说明未配置 port 时的默认行为,以提高配置的清晰度。
...@@ -28,7 +28,7 @@ VITE_PIN = ...@@ -28,7 +28,7 @@ VITE_PIN =
28 # VITE_PROXY_TARGET = https://www.wxgzjs.cn/ 28 # VITE_PROXY_TARGET = https://www.wxgzjs.cn/
29 VITE_PROXY_TARGET = https://wxm.behalo.cc/ 29 VITE_PROXY_TARGET = https://wxm.behalo.cc/
30 30
31 -# PC端地址 31 +# PC端地址(对应 Vite 默认开发端口 5173)
32 VITE_MOBILE_URL = http://localhost:5173/ 32 VITE_MOBILE_URL = http://localhost:5173/
33 33
34 # 欢迎页配置 34 # 欢迎页配置
......
1 # E2E 测试环境变量 1 # E2E 测试环境变量
2 2
3 -# 本地开发服务器(通过代理访问测试服务器 3 +# 本地开发服务器(对应 Vite 默认开发端口 5173
4 VITE_BASE_URL=http://localhost:5173 4 VITE_BASE_URL=http://localhost:5173
5 PLAYWRIGHT_BASE_URL=http://localhost:5173 5 PLAYWRIGHT_BASE_URL=http://localhost:5173
6 6
......
...@@ -86,7 +86,7 @@ export default ({ mode }) => { ...@@ -86,7 +86,7 @@ export default ({ mode }) => {
86 server: { 86 server: {
87 host: '0.0.0.0', 87 host: '0.0.0.0',
88 // port: viteEnv.VITE_PORT, // 本地服务端口 88 // port: viteEnv.VITE_PORT, // 本地服务端口
89 - port: 0, // 使用随机可用端口 89 + // 不配置 port 时,Vite 默认从 5173 开始尝试可用端口
90 // strictPort: true, // 设为true时若端口已被占用则会直接退出, 而不是尝试下一个可用端口 90 // strictPort: true, // 设为true时若端口已被占用则会直接退出, 而不是尝试下一个可用端口
91 // https: '', 91 // https: '',
92 // open: false, // 在服务器启动时自动在浏览器中打开应用程序. 当此值为字符串时, 会被当作URL的路径名. 92 // open: false, // 在服务器启动时自动在浏览器中打开应用程序. 当此值为字符串时, 会被当作URL的路径名.
......