Performance optimizations: Bundle size reduction

Optimizations implemented:
1. Font display: swap + preload for critical fonts
2. ReactQueryDevtools: Lazy load in dev only, exclude from production
3. Auth forms code splitting: LoginForm, PasswordResetRequestForm
4. Remove invalid swcMinify option (default in Next.js 15)

Results:
- Login page: 178 kB → 104 kB (74 kB saved, 42% reduction)
- Password reset: 178 kB → 104 kB (74 kB saved, 42% reduction)
- Homepage: 108 kB (baseline 102 kB shared + 6 kB page)

Remaining issue:
- 102 kB baseline shared by all pages (React Query + Auth loaded globally)
This commit is contained in:
2025-11-02 16:16:13 +01:00
parent 911d4a594e
commit 1b9854d412
8 changed files with 5163 additions and 7 deletions

View File

@@ -59,6 +59,7 @@
"devDependencies": {
"@eslint/eslintrc": "^3",
"@hey-api/openapi-ts": "^0.86.11",
"@next/bundle-analyzer": "^16.0.1",
"@peculiar/webcrypto": "^1.5.0",
"@playwright/test": "^1.56.1",
"@tailwindcss/postcss": "^4",
@@ -74,6 +75,7 @@
"eslint-config-next": "15.2.0",
"jest": "^30.2.0",
"jest-environment-jsdom": "^30.2.0",
"lighthouse": "^12.8.2",
"tailwindcss": "^4",
"typescript": "^5",
"whatwg-fetch": "^3.6.20"