mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
57a8476086
After each `next experimental-analyze` run, snapshot the output data into a rolling `history/` directory so later builds can use it as a comparison baseline. Each snapshot gets a `metadata.json` with git branch/sha/dirty status, Next.js version, and route count. A `history/history.json` index (newest-first, capped at 20 entries) lets the UI list available baselines without re-reading every snapshot directory. Old snapshots beyond the cap are pruned automatically. The client-side `SnapshotMetadata` type mirror lives in `apps/bundle-analyzer/lib/snapshot.ts` so the compare UI can reference it without a build-time dependency on the Next.js package. <!-- NEXT_JS_LLM_PR --> --------- Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by: Will Binns-Smith <755844+wbinnssmith@users.noreply.github.com>