Skip to content

Commit 701d984

Browse files
committed
perf: eliminate dead code from minified skill scripts
After `drop_console: true` removes console.* calls, Terser left behind constants that were only used for console output (e.g. the RATING object with emoji icons/colors like { good: { icon: "🟢", color: "#0CCE6A" }, ... }). This happened because Terser's single-pass compression couldn't determine that destructured values from those constants were unused after console removal. Fix: add two Terser compress options: - `pure_getters: true` — tells Terser that property accesses (obj.prop, obj[key]) have no side effects, so unused destructured results can be safely dropped - `passes: 2` — runs a second compression pass to eliminate secondary dead code (unused variables whose only consumers were already removed in the first pass) Result: emoji/color constants and their associated destructuring assignments are fully eliminated from the generated skill scripts, reducing token footprint further.
1 parent 3a09ddd commit 701d984

95 files changed

Lines changed: 255 additions & 22633 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/webperf-core-web-vitals/scripts/CLS.js

Lines changed: 2 additions & 56 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)