Vercel
Cost
Performance
Heavy bundle dependency in serverless route
Part of the Caching & cost check · fix arrives as a guide
What it is
A serverless route imports a heavy dependency, inflating the function bundle.
Why it matters
Bundle size is cold-start latency, and cold starts land on real users during traffic ramps. On duration-billed functions you also pay for the initialisation every time a new instance starts.
How to fix it
Import the specific submodule rather than the package root, or load the dependency behind a dynamic import on the code path that needs it. Check the build output for what is actually in the bundle.
Run them all on your app
Connect your repo and your live services with read-only scopes. The first scan is free, and nothing changes without your approval.