- LineSegmentFlow: LobeHub brand icons, concave left curves, glow effects - Dark mode: line colors adapt, animated lines glow in dark theme - Vite: enable LAN access (host: 0.0.0.0) - VSCode: workspace settings for performance optimization - Toast: redesign with icons, progress bar, better animations
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import basicSsl from '@vitejs/plugin-basic-ssl'; // 推荐使用这个插件简化自签名证书管理
|
|
|
|
import path from 'path'
|
|
|
|
// 本地开发默认走 HTTP(localhost 属于安全上下文,clipboard/passkey 均可用);
|
|
// 需要自签名 HTTPS 时设置 VITE_DEV_HTTPS=true
|
|
const useHttps = process.env.VITE_DEV_HTTPS === 'true'
|
|
// 后端地址:默认 make dev-backend 启动的 8080,可用 VITE_DEV_API_TARGET 覆盖
|
|
const apiTarget = process.env.VITE_DEV_API_TARGET || 'http://localhost:8080'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [vue(), tailwindcss(), ...(useHttps ? [basicSsl()] : [])],
|
|
server: {
|
|
https: useHttps ? {} : undefined,
|
|
host: '0.0.0.0', // 允许局域网访问
|
|
port: 5173,
|
|
proxy: {
|
|
// 前端 axios baseURL 为 /api,开发时代理到本地 Go 后端,免去跨域与重建
|
|
'/api': {
|
|
target: apiTarget,
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(import.meta.dirname, 'src'),
|
|
},
|
|
},
|
|
build: {
|
|
// sourcemap: true,
|
|
chunkSizeWarningLimit: 1000,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('src/components')) {
|
|
return 'components';
|
|
}
|
|
|
|
if (id.includes('src/views/dashboard')) {
|
|
return 'views-dashboard'
|
|
}
|
|
|
|
if (id.includes('src/stores')) {
|
|
return 'stores';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
});
|