新增 README 並優化載入效能
根本原因: 專案缺少說明文件;bundle 為單一 910KB 主檔改版快取效率差,且每次開頁 與連續操作都會重複呼叫 Google Sheets API。 影響: 主 chunk 降至 216KB(react/antd 拆出可長期快取,jsrsasign 僅非安全來源 才動態載入);平台清單 sessionStorage 快取 5 分鐘、平台分頁記憶體快取 60 秒;機台圖片懶載入;InputNumber 改用 suffix 消除棄用警告。 修法: - vite.config.ts 加入 manualChunks 拆分 react / antd+dayjs - GoogleSheetService 加入兩層快取 - Image 元件預設 loading="lazy" - SDGame 三個 InputNumber 的 addonAfter 改為 suffix - 新增 README.md(功能、開發、技術備註、部署) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+10
-1
@@ -21,7 +21,16 @@ export default defineConfig({
|
||||
},
|
||||
publicDir: "build-templates",
|
||||
build: {
|
||||
outDir: "./build"
|
||||
outDir: "./build",
|
||||
rollupOptions: {
|
||||
output: {
|
||||
// 拆分第三方套件,縮小主 chunk 並提升瀏覽器快取命中率
|
||||
manualChunks: {
|
||||
react: ["react", "react-dom", "react-router-dom"],
|
||||
antd: ["antd", "dayjs"],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
base: "./",
|
||||
// envDir: "./viteEnv",
|
||||
|
||||
Reference in New Issue
Block a user