38 lines
958 B
TypeScript
38 lines
958 B
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
import Components from 'unplugin-vue-components/vite'
|
|
import { BootstrapVueNextResolver } from 'bootstrap-vue-next'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig(({ command }) => ({
|
|
// 线上部署在 https://escort.huashengtec.com/admin/,本地开发仍保持根路径
|
|
base: command === 'build' ? '/admin/' : '/',
|
|
plugins: [
|
|
vue(),
|
|
vueDevTools(),
|
|
Components({
|
|
resolvers: [BootstrapVueNextResolver()],
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'~': fileURLToPath(new URL('./src', import.meta.url))
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'^/user/': {
|
|
target: 'http://localhost:9010',
|
|
changeOrigin: true,
|
|
},
|
|
'^/health/': {
|
|
target: 'http://localhost:9004',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
}))
|