hn_platform_h5/vite.config.js

43 lines
1.5 KiB
JavaScript
Raw Normal View History

2025-12-01 13:20:43 +08:00
import { defineConfig } from 'vite'
import removeConsole from 'vite-plugin-remove-console'
import uni from '@dcloudio/vite-plugin-uni'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [uni(), removeConsole()],
server: {
2025-12-09 10:42:45 +08:00
// 自动打开浏览器
open: true,
2025-12-01 13:20:43 +08:00
proxy: {
// 在此处编写代理规则
2025-12-10 17:45:01 +08:00
// '/api': {
// // target: 'http://112.29.103.165:1616', // 测试环境
// // target: 'http://192.168.0.133:58080', // 梁超
// // target: 'http://192.168.0.14:42880/ldlz/', // 测试环境
// // target: 'http://192.168.0.234:1917/hnAma/',
// // target: 'http://192.168.0.234:38080/hd-real-name', // 方亮
// changeOrigin: true,
// rewrite: (path) => {
// return path.replace(/\/api/, '')
// },
// },
// 实名制系统代理规则
'/bmw': {
2025-12-12 11:22:30 +08:00
// target: 'http://192.168.0.234:1917/hnAma/',
target: 'http://192.168.0.14:1917/hnAma/',
2025-12-01 13:20:43 +08:00
changeOrigin: true,
rewrite: (path) => {
2025-12-10 17:45:01 +08:00
return path.replace(/\/bmw/, '')
},
},
'/leader': {
target: 'http://192.168.0.14:42880/ldlz/',
changeOrigin: true,
rewrite: (path) => {
return path.replace(/\/leader/, '')
2025-12-01 13:20:43 +08:00
},
},
},
},
})