2026-07-10 16:44:23 +08:00
|
|
|
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 path from 'node:path'
|
|
|
|
|
|
|
|
|
|
// https://vite.dev/config/
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [
|
|
|
|
|
vue(),
|
|
|
|
|
AutoImport({
|
2026-07-16 11:03:54 +08:00
|
|
|
resolvers: [ElementPlusResolver({ importStyle: 'css' })],
|
2026-07-10 16:44:23 +08:00
|
|
|
}),
|
|
|
|
|
Components({
|
2026-07-16 11:03:54 +08:00
|
|
|
resolvers: [ElementPlusResolver({ importStyle: 'css' })],
|
2026-07-10 16:44:23 +08:00
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': path.resolve(__dirname, 'src'),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
server: {
|
2026-07-21 09:23:43 +08:00
|
|
|
port: 16801,
|
2026-07-10 16:44:23 +08:00
|
|
|
proxy: {
|
2026-07-21 09:23:43 +08:00
|
|
|
// Frontend uses /api and proxies to the local five-digit backend port.
|
2026-07-10 16:44:23 +08:00
|
|
|
'/api': {
|
2026-07-21 09:23:43 +08:00
|
|
|
target: 'http://localhost:17861',
|
2026-07-10 16:44:23 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|