analyze-bundle

oleh vercel

Konversi data penganalisis bundel Next.js ke NDJSON dan jelajahi

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)'

Lebih banyak skill dari vercel

benchmark-sandbox
vercel
Jalankan skenario evaluasi vercel-plugin di Vercel Sandbox, bukan di panel WezTerm lokal. Menyediakan microVM sementara dengan Claude Code + plugin yang sudah terinstal sebelumnya,…
official
emil-design-eng
vercel
Skill ini mengodekan filosofi Emil Kowalski tentang polesan UI, desain komponen, keputusan animasi, dan detail tak terlihat yang membuat perangkat lunak terasa hebat.
official
vercel-react-best-practices
vercel
Panduan optimasi performa React dan Next.js dari Vercel Engineering. Skill ini harus digunakan saat menulis, meninjau, atau merefaktor kode React/Next.js…
official
vercel-react-best-practices
vercel
Panduan optimasi performa React dan Next.js dari Vercel Engineering. Skill ini harus digunakan saat menulis, meninjau, atau merefaktor kode React/Next.js…
official
write-guide
vercel
Hasilkan panduan teknis yang mengajarkan kasus penggunaan dunia nyata melalui contoh-contoh progresif. Konsep diperkenalkan hanya saat pembaca membutuhkannya.
official
release
vercel
Release vercel-plugin — jalankan gates, naikkan versi, hasilkan artefak, commit, dan push. Gunakan saat diminta untuk "release", "ship", "bump and push", atau "cut a release".
official
deepsec
vercel
Jalankan DeepSec terhadap pemeriksaan proyek Vercel dari dev3000. Gunakan untuk pengaturan DeepSec satu klik, bootstrap konteks proyek, pemrosesan awal terbatas, dan…
official
backport-pr
vercel
Melakukan backport pull request Next.js yang sudah digabung dari canary ke cabang rilis sebelumnya seperti next-16-2. Gunakan saat pengguna meminta untuk backport, cherry-pick, atau membuka…
official