Files
admin-sjzx/vite.config.ts

41 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-02-19 13:44:32 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
2024-04-07 13:43:30 +08:00
import { svgBuilder } from '/@/components/icon/svg/index'
2024-02-19 13:44:32 +08:00
import path from 'path'
2024-04-07 13:43:30 +08:00
const nodeResolve = (dir: string): any => path.resolve(__dirname, '.', dir)
2024-02-19 13:44:32 +08:00
// https://vitejs.dev/config/
export default defineConfig({
2024-04-07 13:43:30 +08:00
plugins: [vue(), svgBuilder('./src/assets/icons/'), vueJsx()],
2024-02-19 13:44:32 +08:00
server: {
2024-02-19 16:38:49 +08:00
host: '0.0.0.0',
2024-04-18 14:54:35 +08:00
open: true,
2024-02-19 13:44:32 +08:00
proxy: {
'/api': {
2024-04-09 16:52:11 +08:00
// target: 'http://192.168.1.31:10215', //数据中心
2024-03-14 14:03:21 +08:00
target: 'http://192.168.1.31:10215', //数据中心
2024-02-19 13:44:32 +08:00
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, '') //路径重写,把'/api'替换为''
2024-02-28 09:42:07 +08:00
},
'/map': {
2024-03-08 10:33:06 +08:00
target: 'http://192.168.1.125:8088', //数据中心
changeOrigin: true
2024-03-08 10:33:06 +08:00
}
2024-04-07 13:43:30 +08:00
// '/hzj': {
// target: 'http://13764779092.gnway.cc', //数据中心
// changeOrigin: true,
// rewrite: path => path.replace(/^\/hzj/, '') //路径重写,把'/api'替换为''
// }
2024-02-19 13:44:32 +08:00
}
},
resolve: {
alias: {
2024-04-07 13:43:30 +08:00
'/@': nodeResolve('.src'),
2024-02-19 13:44:32 +08:00
'@': nodeResolve('src'),
'~': nodeResolve('public')
}
}
})