25 lines
585 B
TypeScript
25 lines
585 B
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
export default defineConfig({
|
|
plugins: [vue(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8052',
|
|
changeOrigin: true,
|
|
ws: true
|
|
}
|
|
}
|
|
},
|
|
// 支持通过环境变量设置 base URL(开发时测试用)
|
|
base: process.env.VITE_BASE_URL || '/'
|
|
})
|