feat: reduce first load js size from 500kb to 85kb

This commit is contained in:
Yifei Zhang
2023-03-20 15:11:04 +00:00
parent f5aef317df
commit ce5abac9fb
4 changed files with 77 additions and 10 deletions

View File

@@ -36,3 +36,54 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
## build log
### raw
Route (app) Size First Load JS
┌ ○ / 449 kB 517 kB
├ λ /api/chat 0 B 0 B
└ ℇ /api/chat-stream 0 B 0 B
+ First Load JS shared by all 68.8 kB
├ chunks/455-0a9fbb1180548580.js 66.4 kB
├ chunks/main-app-19b36671ec6a549e.js 204 B
└ chunks/webpack-dd78d1150b6f4f4a.js 2.15 kB
Route (pages) Size First Load JS
─ ○ /404 179 B 84.6 kB
+ First Load JS shared by all 84.4 kB
├ chunks/main-303e01cd7449e20b.js 82.1 kB
├ chunks/pages/_app-907dedfd0e4177db.js 192 B
### dynamic markdown
Route (app) Size First Load JS
┌ ○ / 64.2 kB 133 kB
├ λ /api/chat 0 B 0 B
└ ℇ /api/chat-stream 0 B 0 B
+ First Load JS shared by all 68.9 kB
├ chunks/455-0a9fbb1180548580.js 66.4 kB
├ chunks/main-app-19b36671ec6a549e.js 204 B
└ chunks/webpack-3b3874680bea117d.js 2.26 kB
Route (pages) Size First Load JS
─ ○ /404 179 B 84.7 kB
+ First Load JS shared by all 84.5 kB
├ chunks/main-303e01cd7449e20b.js 82.1 kB
├ chunks/pages/_app-907dedfd0e4177db.js 192 B
└ chunks/webpack-3b3874680bea117d.js 2.26 kB
### dynamic emoji
Route (app) Size First Load JS
┌ ○ / 16.1 kB 85 kB
├ λ /api/chat 0 B 0 B
└ ℇ /api/chat-stream 0 B 0 B
+ First Load JS shared by all 68.9 kB
├ chunks/455-0a9fbb1180548580.js 66.4 kB
├ chunks/main-app-19b36671ec6a549e.js 204 B
└ chunks/webpack-2bfaffd64d73d7a1.js 2.33 kB
Route (pages) Size First Load JS
─ ○ /404 179 B 84.8 kB
+ First Load JS shared by all 84.6 kB
├ chunks/main-303e01cd7449e20b.js 82.1 kB
├ chunks/pages/_app-907dedfd0e4177db.js 192 B
└ chunks/webpack-2bfaffd64d73d7a1.js 2.33 kB