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

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,…
official
emil-design-eng
vercel
Diese Fertigkeit kodiert Emil Kowalskis Philosophie zu UI-Verfeinerung, Komponentendesign, Animationsentscheidungen und den unsichtbaren Details, die Software großartig wirken lassen.
official
vercel-react-best-practices
vercel
Richtlinien zur Leistungsoptimierung von React und Next.js von Vercel Engineering. Diese Fähigkeit sollte beim Schreiben, Überprüfen oder Refaktorisieren von React/Next.js…
official
vercel-react-best-practices
vercel
Richtlinien zur Leistungsoptimierung von React und Next.js von Vercel Engineering. Diese Fähigkeit sollte beim Schreiben, Überprüfen oder Refaktorisieren von React/Next.js…
official
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.
official
release
vercel
Vercel-Plugin veröffentlichen — Gates ausführen, Version erhöhen, Artefakte generieren, committen und pushen. Verwenden, wenn aufgefordert, „zu veröffentlichen“, „auszuliefern“, „Version zu erhöhen und zu pushen“ oder „ein Release zu erstellen“.
official
deepsec
vercel
Führen Sie DeepSec gegen einen Vercel-Projekt-Checkout von dev3000 aus. Verwenden Sie für die Ein-Klick-DeepSec-Einrichtung, das Bootstrapping des Projektkontexts, die begrenzte Erstverarbeitung und…
official
backport-pr
vercel
Backportiere einen gemergten Next.js Pull-Request von canary auf einen früheren Release-Branch wie next-16-2. Verwende, wenn der Benutzer darum bittet, einen Backport, Cherry-Pick oder das Öffnen eines…
official