44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
import Components from 'unplugin-vue-components/vite'
|
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
import { VantResolver } from '@vant/auto-import-resolver';
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
AutoImport({
|
|
resolvers: [ElementPlusResolver(),VantResolver()],
|
|
}),
|
|
Components({
|
|
resolvers: [ElementPlusResolver(),VantResolver()],
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
host: true,
|
|
port: 80,
|
|
proxy: {
|
|
'/app': {
|
|
target: 'http://10.138.8.154:8081',
|
|
changeOrigin: true
|
|
// rewrite: (path) => path.replace(/^\/app/, '')
|
|
},
|
|
'/admin': {
|
|
target: 'http://10.138.8.154:8080',
|
|
changeOrigin: true
|
|
// rewrite: (path) => path.replace(/^\/admin/, '')
|
|
}
|
|
}
|
|
}
|
|
})
|