2026-05-22 19:23:43 +08:00
|
|
|
import { defineConfig } from 'vite'
|
2026-05-20 22:36:22 +08:00
|
|
|
import react from '@vitejs/plugin-react'
|
|
|
|
|
import tailwindcss from '@tailwindcss/vite'
|
2026-05-21 17:19:58 +08:00
|
|
|
import path from 'node:path'
|
2026-05-20 22:36:22 +08:00
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [react(), tailwindcss()],
|
2026-05-21 17:19:58 +08:00
|
|
|
resolve: {
|
2026-05-22 19:23:43 +08:00
|
|
|
alias: { '@': path.resolve(import.meta.dirname, 'src') },
|
|
|
|
|
},
|
|
|
|
|
build: {
|
|
|
|
|
rollupOptions: {
|
|
|
|
|
output: {
|
|
|
|
|
manualChunks(id: string) {
|
|
|
|
|
if (id.includes('node_modules/react') || id.includes('node_modules/react-dom')) return 'react'
|
|
|
|
|
if (id.includes('node_modules/antd') || id.includes('node_modules/@ant-design')) return 'antd'
|
|
|
|
|
if (id.includes('node_modules/echarts')) return 'echarts'
|
|
|
|
|
if (id.includes('node_modules/react-markdown') || id.includes('node_modules/react-syntax-highlighter') || id.includes('node_modules/remark-gfm')) return 'markdown'
|
|
|
|
|
if (id.includes('node_modules/@tanstack')) return 'query'
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-05-21 17:19:58 +08:00
|
|
|
},
|
|
|
|
|
},
|
2026-05-20 22:36:22 +08:00
|
|
|
server: {
|
2026-05-22 19:23:43 +08:00
|
|
|
port: 5174, host: true,
|
2026-05-20 22:36:22 +08:00
|
|
|
proxy: {
|
|
|
|
|
'/api': 'https://api.longde.cloud',
|
|
|
|
|
'/admin-api': 'https://api.longde.cloud',
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-05-22 19:23:43 +08:00
|
|
|
})
|