bundle-size-optimization
БесплатноБез исполняемых скриптовНе проверенUse when working in this repository on JS bundle size, gzip regressions, benchmark scenarios, source attribution, treeshaking, dead code elimination, or…
от TanStack★ 15 408 звёзд на GitHubОб этом скилле
Bundle Size Optimization
Overview
Optimize measured client bundles, not source text. The source of truth is @benchmarks/bundle-size:measure, benchmarks/bundle-size/results/current.json, and emitted JS in benchmarks/bundle-size/dist/.
Use benchmark:bundle-size:run for local iterations. It uses the same measurement script and builds the selected packages through Nx.
Commands
| Need | Command |
|---|---|
| Full benchmark | pnpm benchmark:bundle-size:run |
| Save baseline | pnpm benchmark:bundle-size:run --name baseline --scenario react-router.minimal |
| Measure and compare | pnpm benchmark:bundle-size:run --baseline baseline --scenario react-router.minimal |
| Save a candidate | pnpm benchmark:bundle-size:run --name candidate --baseline baseline --scenario react-router.minimal |
| Test, measure, compare | pnpm benchmark:bundle-size:run --baseline baseline --scenario react-router.minimal --test-projects @tanstack/router-core,@tanstack/react-router -- tests/path.test.ts tests/link.test.tsx |
| Read result | pnpm benchmark:bundle-size:query --id react-router.minimal |
| Compare existing results | pnpm benchmark:bundle-size:diff --baseline ./baseline.json --id react-router.minimal |
| History deltas | git fetch --quiet origin gh-pages && pnpm benchmark:bundle-size:history --id react-router.minimal --top-deltas 20 |
| Collect source attribution | pnpm benchmark:bundle-size:run --scenario react-router.minimal --analysis |
| Read source attribution | pnpm benchmark:bundle-size:analyze --id react-router.minimal |
| Symbol refs | pnpm ts:symbol-references -- --project packages/router-core/tsconfig.json --file packages/router-core/src/utils.ts --symbol last |
Named runs save metrics and logs in benchmarks/bundle-size/results/runs/<name>/. Existing named results cannot be overwritten.
Without --name, runs replace results/current.json and the logs for the steps they run.
--baseline accepts a run name or a JSON file path. --results-dir <dir> changes the results root for the current and named runs.
Emitted bundles still use dist/ unless --dist-dir specifies another directory.
For named results, pass --current benchmarks/bundle-size/results/runs/<name>/current.json to the query, diff, or analysis tools.
Rules
- Run one Nx command at a time.
- Use the runner instead of shell chains for environment variables, redirection, exit codes, log tails, and result queries.
- For agent runs, use
pnpm --silent benchmark:bundle-size:run ...to omit the package-manager command echo. - The runner sets
CI=1andNX_DAEMON=false. It saves full output intests.logandmeasure.logbesidecurrent.json. - If a step fails, the runner stops and prints at most 40 log lines, limited to 8,000 characters. Read the reported log for more detail.
- Quiet stdout does not indicate an Nx hang. Inspect the reported log for progress before applying the Nx reset/retry guardrail.
- Use
--test-projectsfor the packages that changed. Pass unit-test file selectors and flags after--. - The runner does not select tests automatically. Keep type tests, performance benchmarks, and e2e tests separate.
- Keep baseline and candidate scenario selections and measurement flags identical. Use a new
--namefor each retained snapshot. - Do not add
--skip-package-buildsafter package source changes. The default rebuilds through Nx and preserves valid package caches. - Track `
Установить bundle-size-optimization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл bundle-size-optimization?
Use when working in this repository on JS bundle size, gzip regressions, benchmark scenarios, source attribution, treeshaking, dead code elimination, or Rolldown annotations.
Как установить скилл bundle-size-optimization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bundle-size-optimization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic