You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`npm run build` showed the main JavaScript bundle was ~981kB minified, which slows initial page load on mobile networks and lower-end devices.
5
+
6
+
## Impact
7
+
- Slower first contentful paint and interaction readiness.
8
+
- Higher data usage for users.
9
+
- Poor scalability as more features are added.
10
+
11
+
## Root cause
12
+
`App.tsx` eagerly imported all route pages and shared UI modules, so Vite emitted one large entry chunk.
13
+
14
+
## Resolution in this PR
15
+
- Added route-level lazy loading with `React.lazy` and `Suspense` for all pages and dashboard components.
16
+
- Added a lightweight loading fallback while split chunks load.
17
+
18
+
## Validation
19
+
After the fix, `npm run build` emits multiple chunks and the main application entry (`index-*.js`) drops from ~981kB to ~70kB, with code split across route chunks.
0 commit comments