adamyonk
(Adam Jahnke)
January 12, 2025, 2:22am
1
I am including some large packages in my build, namely rehype-starry-night and @wooorm /starty-night, and it seems to be inflating my build massively.
I can see in the build logs that there is a huge webpack cache being copied in, is there some way to ignore or exclude that? Iβm confused about how to reduce this size.
adamyonk
(Adam Jahnke)
January 12, 2025, 2:23am
2
Also, Iβm confused why .git
would be in there at all.
amyegan
(Amy Egan)
January 14, 2025, 9:52pm
3
Hey @adamyonk ! I shared some related info in another thread.
Please give those tips a try and let me know how it goes
1 Like
adamyonk
(Adam Jahnke)
January 16, 2025, 2:01am
4
I think that just removing the .git
directory would get these functions under the limit - are there any hooks I can tap into to remove that once the repo is cloned, before that gets unzipped into the different serverless functions?
adamyonk
(Adam Jahnke)
January 16, 2025, 2:57am
5
Using bundle analyzer, here is the client bundle size:
And nodejs bundle size:
I just donβt understand how this could possibly be breaking a 250MB barrier!
adamyonk
(Adam Jahnke)
January 16, 2025, 5:12am
6
Some more data:
Vercel CLI 39.3.0
WARNING: You should not upload the `.next` directory.
Installing dependencies...
up to date in 425ms
197 packages are looking for funding
run `npm fund` for details
Detected Next.js version: 15.1.4
Running "npm run build"
> build
> next build
β² Next.js 15.1.4
- Experiments (use with caution):
Β· turbo
Creating an optimized production build ...
β Compiled successfully
β Linting and checking validity of types
β Collecting page data
β Generating static pages (42/42)
β Collecting build traces
β Finalizing page optimization
Route (app) Size First Load JS
β β / 258 B 109 kB
β β /_not-found 979 B 106 kB
β β /[slug] 141 B 105 kB
β β /colophon
β β /resume
β β /uses
β β /feed.json 141 B 105 kB
β β /feed.xml 141 B 105 kB
β β /posts/[slug] 231 B 109 kB
β β /posts/2025-01-03-html-search-input
β β /posts/2019-11-23-raspberry-pi-kiosk
β β /posts/2018-12-29-screencasting-using-quicktime
β β [+13 more paths]
β β /posts/tagged/[slug] 258 B 109 kB
β /posts/tagged/javascript
β /posts/tagged/gatsby
β /posts/tagged/tools
β [+13 more paths]
+ First Load JS shared by all 105 kB
β chunks/4bd1b696-20882bf820444624.js 52.9 kB
β chunks/517-4122b31d994211b5.js 50.5 kB
β other shared chunks (total) 1.89 kB
β (Static) prerendered as static content
β (SSG) prerendered as static HTML (uses generateStaticParams)
Traced Next.js server files in: 115.386ms
Created all serverless functions in: 886.539ms
Collected static files (public/, static/, .next/static): 2.171ms
β
Build Completed in .vercel/output [17s]
β du -sh .vercel/output
6.8M .vercel/output