case-admin/vite.config.js
zoujiandong 4b8057add0 first
2025-03-07 17:40:15 +08:00

41 lines
1004 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite';
import AutoImport from 'unplugin-auto-import/vite';
import {
VuetifyResolver
} from 'unplugin-vue-components/resolvers';
export default defineConfig(({ mode }) =>{
let base='';
if(mode==='test' || mode==='production'){
base='/admin/web';
}
return {
base: base,
plugins: [vue(),
AutoImport({
// 自动导入 Vue 相关函数ref, reactive, toRef 等
imports: ['vue'],
}),
Components({
resolvers: [VuetifyResolver()],
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
dirs: ['src/components', 'src/views'],
}),
],
server: {
open: false,
port: 3000,
proxy: {
'/admin': {
target: 'https://dev-caseplatform.igandan.com/admin',//'https://dev-hepa.igandan.com/admin', //
changeOrigin: true,
rewrite: (path) => path.replace(/^\/admin/, '')
},
},
},
}
})