From 52704811a7a0be49fb5d02768883f312b284ff50 Mon Sep 17 00:00:00 2001 From: mutoe Date: Fri, 26 Sep 2025 21:01:00 +0800 Subject: [PATCH 1/2] refactor: switch Home component to lazy loading in router configuration --- src/router.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/router.ts b/src/router.ts index 6d9331e1..33f1c8f1 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,6 +1,5 @@ import type { RouteParams, RouteRecordRaw } from 'vue-router' import { createRouter, createWebHashHistory } from 'vue-router' -import Home from './pages/Home.vue' import { isAuthorized } from './store/user' export type AppRouteNames = @@ -20,17 +19,17 @@ export const routes: RouteRecordRaw[] = [ { name: 'global-feed', path: '/', - component: Home, + component: () => import('./pages/Home.vue'), }, { name: 'my-feed', path: '/my-feeds', - component: Home, + component: () => import('./pages/Home.vue'), }, { name: 'tag', path: '/tag/:tag', - component: Home, + component: () => import('./pages/Home.vue'), }, { name: 'article', From dea298cf86896c1d03d3271595b057efbc8fad0b Mon Sep 17 00:00:00 2001 From: mutoe Date: Fri, 26 Sep 2025 21:12:17 +0800 Subject: [PATCH 2/2] chore: update `size-limit` configuration to include additional paths and exclude specific assets --- package.json | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a78180b6..505b8daf 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,20 @@ }, "size-limit": [ { - "path": "dist/**/*.js" + "name": "html", + "path": "dist/index.html" + }, + { + "name": "css", + "path": "dist/**/*.css" + }, + { + "name": "bundle", + "path": "dist/**/index-*.js" + }, + { + "name": "others(pages, hooks, etc)", + "path": "dist/**/!(index-*.js|*.css)" } ] }