AGENT SKILL

frontend-bundler-config

暂无简介

License 许可
MIT
所属仓库
lookatitude/guild
最近更新
2026-11-06
Stars
★ 8
Forks
0

02 资源文件 1

03 SKILL.md 正文

frontend-bundler-config

Every config change ships with a measurement — bundle bytes, build seconds, or dev-server start — proving it helped.

What you do

Tune the frontend build against a number, not a hunch. Take a measurement first, change one thing, measure again.

  • Start from data: run the bundle analyzer or capture build timing before touching config.
  • Code-split at route and heavy-dependency boundaries; lazy-load what's below the fold or behind a click.
  • Make tree shaking actually work — ship ESM, keep sideEffects honest in package.json, and avoid barrel files that pull in the world.
  • Hash asset filenames for cache-busting; inline only the smallest assets.
  • Inject env vars at build time from a documented allowlist; never let a secret reach the client bundle — everything shipped is public.
  • Set a bundle-size budget and make the build fail when it's exceeded.

Output shape

A config diff plus its measurement:

  1. Config diff — the Vite / Webpack / esbuild / Rollup change.
  2. Measurement — before/after bundle size, build time, or dev-server start.
  3. Split points — which chunks were carved out and what triggers their load.
  4. Env-var contract — the build-time variable allowlist (and what's deliberately excluded).
  5. Budget — the size budget and where it's enforced in the build.

Anti-patterns

  • A config change with no before/after number — you can't tell if it helped or hurt.
  • Secrets in client-exposed env vars — anything in the bundle is readable by anyone.
  • Barrel files or CommonJS interop silently defeating tree shaking.
  • One monolithic chunk — no splitting, slow first paint, nothing cacheable in isolation.
  • Unbounded bundle growth — no budget, no alarm until users complain about load time.
  • Over-splitting into hundreds of micro-chunks — a request waterfall that's slower than one chunk.

Handoff

Return the config diff and measurement to the invoking frontend specialist. The CI step that runs this build and enforces the budget gate is devops-ci-cd-pipeline territory — frontend writes the build script, devops wires the pipeline. This skill does not dispatch.

04 同仓库更多 Skills