30 lines
709 B
JavaScript
30 lines
709 B
JavaScript
import path from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
base: '/admin/',
|
|
resolve: {
|
|
alias: {
|
|
// 与前台共用积木渲染,避免重复维护
|
|
'@yh-web': path.resolve(__dirname, '../web/src')
|
|
}
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
host: true,
|
|
// 开发时 /api 也走域名(与 .env.development 中 VITE_API_BASE 一致)
|
|
proxy: {
|
|
'/api': {
|
|
target: 'https://yuheng.yuxindazhineng.com',
|
|
changeOrigin: true,
|
|
secure: true
|
|
}
|
|
}
|
|
}
|
|
})
|