analyze-bundle

von vercel

Next.js-Bundle-Analyzer-Daten in NDJSON konvertieren und erkunden

npx skills add https://github.com/vercel-labs/dev3000 --skill analyze-bundle

analyze-to-ndjson

Converts Next.js bundle analyzer binary .data files into grep/jq-friendly NDJSON.

Analyze artifacts

This workflow pre-generates analyzer artifacts in:

  • .next/diagnostics/analyze/ndjson/routes.ndjson
  • .next/diagnostics/analyze/ndjson/sources.ndjson
  • .next/diagnostics/analyze/ndjson/output_files.ndjson
  • .next/diagnostics/analyze/ndjson/module_edges.ndjson
  • .next/diagnostics/analyze/ndjson/modules.ndjson

Focus on reading these files and using their evidence to prioritize changes.

Output files

FileWhat's in it
modules.ndjsonGlobal module registry (id, ident, path)
module_edges.ndjsonModule dependency graph (from, to, kind: sync/async)
sources.ndjsonPer-route source tree with sizes and environment flags
chunk_parts.ndjsonGranular size data: one line per (source, output_file) pair
output_files.ndjsonPer-route output files with aggregated sizes
routes.ndjsonRoute-level summaries

Browsing the output

Route overview

jq -s 'sort_by(-.total_compressed_size)' .next/diagnostics/analyze/ndjson/routes.ndjson

Find large sources

jq -s '
  group_by(.full_path)
  | map(max_by(.compressed_size))
  | sort_by(-.compressed_size)
  | .[0:10]
  | .[] | {full_path, compressed_size, size, route}
' .next/diagnostics/analyze/ndjson/sources.ndjson

Client-side JS

grep '"client":true' .next/diagnostics/analyze/ndjson/sources.ndjson \
  | grep '"js":true' \
  | jq -s 'sort_by(-.compressed_size) | .[0:10] | .[] | {full_path, compressed_size}'

Module dependencies

grep '"from":42,' .next/diagnostics/analyze/ndjson/module_edges.ndjson | jq .to
grep '"to":42,' .next/diagnostics/analyze/ndjson/module_edges.ndjson | jq .from
grep 'react-dom' .next/diagnostics/analyze/ndjson/modules.ndjson | jq '{id, path}'

Output files for a route

grep '"route":"/"' .next/diagnostics/analyze/ndjson/output_files.ndjson \
  | jq -s 'sort_by(-.total_compressed_size) | .[0:10] | .[] | {filename, total_compressed_size, num_parts}'

Directory tree for a route

grep '"route":"/"' .next/diagnostics/analyze/ndjson/sources.ndjson \
  | jq 'select(.parent_id == null)'

Mehr Skills von vercel

vercel
vercel
Emulierte Vercel-REST-API für lokale Entwicklung und Tests. Verwenden, wenn der Benutzer lokal mit Vercel-API-Endpunkten interagieren, Vercel-Integrationen testen,…
cron-jobs
vercel
Vercel Cron Jobs Konfiguration und Best Practices. Verwenden beim Hinzufügen, Bearbeiten oder Debuggen geplanter Aufgaben in vercel.json.
codegen
vercel
Codegenerierungs-Hilfsprogramme für json-render. Verwenden Sie diese beim Generieren von Code aus UI-Spezifikationen, beim Erstellen benutzerdefinierter Code-Exporteure, beim Durchlaufen von Spezifikationen oder beim Serialisieren von Eigenschaften für…
next-best-practice
vercel
Next.js Best Practices - Dateikonventionen, RSC-Grenzen, Datenmuster, asynchrone APIs, Metadaten, Fehlerbehandlung, Routen-Handler, Bild-/Schriftoptimierung,…
benchmark-sandbox
vercel
Führt vercel-plugin-eval-Szenarien in Vercel Sandboxes aus, anstatt in lokalen WezTerm-Panels. Stellt temporäre Mikro-VMs mit vorinstalliertem Claude Code + Plugin bereit,…
write-guide
vercel
Erstelle eine technische Anleitung, die einen realen Anwendungsfall durch progressive Beispiele vermittelt. Konzepte werden nur dann eingeführt, wenn der Leser sie benötigt.
benchmark-testing
vercel
Erstelle und starte Benchmark-Testprojekte, um die vercel-plugin-Skill-Injektion in realistischen Szenarien zu testen. Richtet isolierte Verzeichnisse ein, installiert die…
ai-gateway
vercel
Vercel AI Gateway Expertenanleitung. Verwenden Sie bei der Konfiguration von Modell-Routing, Anbieter-Failover, Kostenverfolgung oder der Verwaltung mehrerer KI-Anbieter über eine einheitliche…