2023-12-21 16:42:39 +08:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
2023-12-28 14:06:57 +08:00
|
|
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
2023-12-21 16:42:39 +08:00
|
|
|
import path from 'path'
|
2024-01-05 15:14:35 +08:00
|
|
|
|
2023-12-21 16:42:39 +08:00
|
|
|
const nodeResolve = (dir: string) => path.resolve(__dirname, '.', dir)
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
|
export default defineConfig({
|
2023-12-28 14:06:57 +08:00
|
|
|
plugins: [vue(), vueJsx()],
|
2023-12-26 08:45:15 +08:00
|
|
|
server: {
|
2024-08-06 15:01:11 +08:00
|
|
|
host: '0.0.0.0',
|
|
|
|
|
open: true,
|
2023-12-26 08:45:15 +08:00
|
|
|
proxy: {
|
|
|
|
|
'/api': {
|
2024-01-22 19:13:58 +08:00
|
|
|
// target: 'http://192.168.1.81:10215', //数据中心
|
2024-08-06 15:01:11 +08:00
|
|
|
// target: 'http://192.168.1.24:10215', //
|
|
|
|
|
// target: 'http://192.168.1.122:10215', //gfh
|
|
|
|
|
// target: 'http://192.168.1.127:10215', //cdf
|
|
|
|
|
// target: 'http://192.168.1.125:10215',
|
2025-10-11 10:35:25 +08:00
|
|
|
target: 'http://192.168.1.103:10215',
|
2024-09-02 18:39:44 +08:00
|
|
|
// target: 'https://pqmcn.com:8092/api', //治理
|
2024-08-06 15:01:11 +08:00
|
|
|
// target:'http://www.zhilitest.com:8089/api',
|
2023-12-26 08:45:15 +08:00
|
|
|
changeOrigin: true,
|
2023-12-26 10:28:29 +08:00
|
|
|
rewrite: path => path.replace(/^\/api/, '') //路径重写,把'/api'替换为''
|
2023-12-26 08:45:15 +08:00
|
|
|
}
|
|
|
|
|
}
|
2024-08-06 15:01:11 +08:00
|
|
|
// port:'3000'
|
2023-12-26 08:45:15 +08:00
|
|
|
},
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|