Source code Releases Performance Cost

Bundle bloat (serverless)

Part of the Cost controls check · fix arrives as a guide

What it is

A serverless function bundle is large enough to affect cold-start time — usually a heavy dependency pulled in for one helper, or an entire SDK imported for a single call.

Why it matters

Bundle size is cold-start latency, and cold starts land on real users during traffic ramps. On platforms that bill by duration you also pay for the initialisation on every cold invocation.

How to fix it

Import the specific submodule rather than the package root, move heavy dependencies behind a dynamic import on the paths that actually need them, and check the bundle analyser output for anything you did not expect to be there.

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.