Files
admin-govern/vite.config.ts

28 lines
785 B
TypeScript
Raw Normal View History

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: {
proxy: {
'/api': {
2024-01-22 19:13:58 +08:00
// target: 'http://192.168.1.81:10215', //数据中心
2024-02-19 11:34:03 +08:00
target: 'https://pqmcn.com:8092/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
}
}
},
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
}
}
})