Bundle Chunk Analyzer
A build-output breakdown: one row per bundle chunk showing its raw and gzipped size, module count, a share-of-total-bundle percentage bar, and a change indicator against the previous build. Chunks over a fixed size threshold get a "Large chunk" warning badge. Built for CI build-size reports and internal engineering dashboards.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/bundle-chunk-analyzer.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/devtools/devtools27.tsx instead.
Usage
The file also exports devtools27Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Devtools27, devtools27Demo } from "@/components/blocks/devtools/devtools27"; export default function Page() { return <Devtools27 {...devtools27Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Bundle breakdown" | Section heading. |
| description | string | "Chunk sizes from the latest production build, compared against the previous build." | Section intro text below the heading. |
| chunks | BundleChunk[] | none | Chunk rows, in the order they should render. |
| className | string | none | Extra classes for the outer section element. |
Types
type BundleChunk = { name: string; sizeKb: number; gzipKb: number; moduleCount: number; /** KB change vs. the previous build. Positive = grew, negative = shrank. */ deltaKb: number; };
Behavior notes
- Entirely static server component; sizes, gzip sizes, module counts, and deltas are whatever the caller passes in, there is no real build analysis or file-system reads happening.
- The share-of-bundle percentage bar is computed from each chunk's sizeKb divided by the sum of every chunk's sizeKb in the array, so the percentages only add up to 100% across the chunks you actually pass in.
- The "Large chunk" badge fires whenever sizeKb exceeds a fixed 150 KB threshold hardcoded in the component; it is not configurable via props.
- The change indicator's color polarity is intentionally inverted from a typical KPI: since a bigger chunk is worse for load time, growth (deltaKb > 0) renders red with an up arrow and shrinkage (deltaKb < 0) renders emerald with a down arrow. A deltaKb of exactly 0 renders a neutral "No change" with a dash, in muted gray.
More DevTools Blocks
View all →api-endpoints-sample-call
API Endpoints With Sample Call
Reference list of API endpoints paired with a live sample request and response panel.
cicd-pipeline-status
CI/CD Pipeline Status
Recent CI/CD pipeline runs with per-stage status chips and overall run badges.
code-diff-viewer
Code Diff Viewer
Unified code diff panel with a file header change summary and colored addition/deletion lines.
keyboard-shortcuts-reference
Keyboard Shortcuts Reference
Grouped keyboard shortcut reference with keycap-styled key combos.
performance-waterfall
Performance Waterfall
Network request waterfall chart with cascading timing bars colored by duration.
service-health-board
Service Health Board
Infrastructure status board with a live summary strip and per-service uptime, latency, and health.