Commit 701d984
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
- .claude/skills
- webperf-core-web-vitals/scripts
- webperf-interaction/scripts
- webperf-loading/scripts
- webperf-media/scripts
- webperf-resources/scripts
- scripts
- skills
- webperf-core-web-vitals/scripts
- webperf-interaction/scripts
- webperf-loading/scripts
- webperf-media/scripts
- webperf-resources/scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments