chore: initial commit of HouseholdBudgetBook (backend, frontend, desktop)

This commit is contained in:
mapleferry committed 2026-11-29 21:29:06 +08:00
commit 4a5db3f1f9
167 files changed
+21732

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'node:path'
/**
* 第三方依赖按稳定性分组,避免业务代码改动时把整个 vendor 也打成新 hash,
* 让浏览器能长期复用 vendor 缓存。
*/
function vendorChunks(id: string): string | undefined {
if (!id.includes('node_modules')) return undefined
if (/[\\/]node_modules[\\/]@tanstack[\\/]/.test(id)) return 'vendor-query'
if (/[\\/]node_modules[\\/](react-router|react-router-dom|@remix-run)[\\/]/.test(id)) {
return 'vendor-router'
}
if (/[\\/]node_modules[\\/](react|react-dom|scheduler)[\\/]/.test(id)) return 'vendor-react'
return undefined
}
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
server: {
proxy: {
'/api': 'http://localhost:8080',
},
},
build: {
rollupOptions: {
output: {
manualChunks: vendorChunks,
},
},
},
})