legacy-js
Installation
SKILL.md
Avoid serving legacy JavaScript to modern browsers
Modern browsers can execute ES6+ code faster and more efficiently; serving them transpiled ES5 with polyfills adds unnecessary weight.
Quick Reference
- Use differential serving (module/nomodule) to target modern and legacy browsers
- Avoid heavy ES5 polyfills for browsers that support ES6+
- Compile code to modern targets to reduce bundle size and improve execution speed
Check
Analyze the project's JavaScript output to see if modern browsers are being served unnecessary ES5 code and polyfills.
Fix
Update the build configuration to use differential serving and set a modern target for your primary JavaScript output.