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-05-09 14:18:39 +08:00
|
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
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-06-12 16:16:02 +08:00
|
|
|
plugins: [
|
|
|
|
|
vue(),
|
|
|
|
|
svgBuilder('./src/assets/icons/'),
|
|
|
|
|
vueJsx(),
|
2024-05-09 14:18:39 +08:00
|
|
|
AutoImport({
|
|
|
|
|
//自动引入
|
2024-06-12 16:16:02 +08:00
|
|
|
imports: ['vue', 'vue-router', 'pinia']
|
|
|
|
|
})
|
2024-05-09 14:18:39 +08:00
|
|
|
],
|
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-29 09:02:06 +08:00
|
|
|
// target: 'http://10.95.53.49:10215', //海南服务器ip
|
2024-09-04 20:59:57 +08:00
|
|
|
// target: 'http://10.118.135.128:10215', ///hsw
|
2024-11-26 16:45:38 +08:00
|
|
|
target: 'http://192.168.1.81:10215', ///hsw
|
2024-06-12 16:16:02 +08:00
|
|
|
// target: 'http://10.119.65.152: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
|
|
|
},
|
2024-06-12 16:16:02 +08:00
|
|
|
'/api-docx': {
|
|
|
|
|
// 文件服务器地址
|
2024-09-04 20:59:57 +08:00
|
|
|
target: 'http://192.168.1.22:9009',
|
2024-06-12 16:16:02 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: path => path.replace(/^\/api-docx/, '')
|
|
|
|
|
},
|
2024-02-28 09:42:07 +08:00
|
|
|
'/map': {
|
2024-04-29 09:02:06 +08:00
|
|
|
// target: 'http://10.95.53.49:8088', //海南服务器ip
|
2024-09-04 20:59:57 +08:00
|
|
|
target: 'http://192.168.1.125:9009', //hsw
|
2024-04-29 09:02:06 +08:00
|
|
|
// target: 'http://192.168.1.125:8088', //数据中心
|
2024-03-12 11:16:54 +08:00
|
|
|
changeOrigin: true
|
2024-03-08 10:33:06 +08:00
|
|
|
}
|
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')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|