40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
import { svgBuilder } from '/@/components/icon/svg/index'
|
|
|
|
import path from 'path'
|
|
|
|
const nodeResolve = (dir: string): any => path.resolve(__dirname, '.', dir)
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [vue(), svgBuilder('./src/assets/icons/'), vueJsx()],
|
|
server: {
|
|
host: '0.0.0.0',
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://192.168.1.31:10215', //数据中心
|
|
// target: 'http://192.168.1.81:10215', //数据中心
|
|
changeOrigin: true,
|
|
rewrite: path => path.replace(/^\/api/, '') //路径重写,把'/api'替换为''
|
|
},
|
|
'/map': {
|
|
target: 'http://192.168.1.125:8088', //数据中心
|
|
changeOrigin: true
|
|
}
|
|
// '/hzj': {
|
|
// target: 'http://13764779092.gnway.cc', //数据中心
|
|
// changeOrigin: true,
|
|
// rewrite: path => path.replace(/^\/hzj/, '') //路径重写,把'/api'替换为''
|
|
// }
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'/@': nodeResolve('.src'),
|
|
'@': nodeResolve('src'),
|
|
'~': nodeResolve('public')
|
|
}
|
|
}
|
|
})
|