- vite.config.ts: 加 base: '/app/',App 部署在子路径 - server/index.ts: MODELS_FILE 支持环境变量覆盖(容器化写权限) - homepage/index.html: 极简开发者风格个人主页(About/Projects/Skills/Contact) - nginx/default.conf: 反向代理,SSE proxy_buffering off,SPA fallback - docker-compose.yml: Nginx + Hono 容器编排,models_data volume 持久化 - deploy.sh: 一键本地构建 + rsync 上传 + 远端重启 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
31 lines
821 B
TypeScript
31 lines
821 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
|
|
export default defineConfig({
|
|
base: '/app/',
|
|
plugins: [react(), tailwindcss()],
|
|
server: {
|
|
proxy: {
|
|
'/api': 'http://localhost:3001',
|
|
},
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules/react') || id.includes('node_modules/react-dom')) {
|
|
return 'vendor-react'
|
|
}
|
|
if (id.includes('@tiptap') || id.includes('lowlight') || id.includes('prosemirror')) {
|
|
return 'vendor-editor'
|
|
}
|
|
if (id.includes('framer-motion') || id.includes('@dnd-kit') || id.includes('lucide-react')) {
|
|
return 'vendor-ui'
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
})
|