Files
admin-govern/vite.config.ts

37 lines
1.4 KiB
TypeScript
Raw Normal View History

2023-12-21 16:42:39 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
const nodeResolve = (dir: string) => path.resolve(__dirname, '.', dir)
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
2023-12-26 08:45:15 +08:00
server: {
proxy: {
'/api': {
// target: "http://192.168.1.115:10215", //黄正剑
// target: "http://192.168.1.22:10215", //超高压
target: "http://192.168.1.9:10215", //数据中心
// target: "http://192.168.1.13:10215", //治理
// target: 'http://192.168.1.18:10215', // 河北
// target: "http://192.168.1.31:10215", // 海南
// target: "http://192.168.1.29:10215", // 冀北
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), //路径重写,把'/api'替换为''
},
'/api1': {
//target: "http://192.168.1.65:7300/mock/6384a6175854f20022dc9300/jibei",
target: 'http://192.168.1.9:8088',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api1/, ''), //路径重写,把'/api'替换为''
}
}
},
2023-12-21 16:42:39 +08:00
resolve: {
alias: {
'@': nodeResolve('src'),
2023-12-26 08:45:15 +08:00
'~': nodeResolve('public')
2023-12-21 16:42:39 +08:00
}
}
})