Wydajność

perf/no-legacy-javascript

Do not ship polyfills and down-level transforms for features your target browsers already support; declare targets once.

drobnaw przeglądarcefe-perf-delivery

Dlaczego

Transpiling classes, async functions and optional chaining for browsers nobody uses makes bundles larger and slower to run, and polyfills for Baseline features are downloaded by every visitor.

Poprawka

Declare browser targets once (a browserslist query such as baseline widely available, or the bundler's build.target), drop blanket polyfill imports (core-js/stable in the entry), and add a polyfill only for a feature you use that is not in your targets. See fe-tooling for the configuration.

Przykłady

{ "browserslist": ["baseline widely available"] }

Źródła

Fakty

Identyfikator
perf/no-legacy-javascript
Waga
drobna
Sprawdzanie
w przeglądarce wymaga wyrenderowanej strony: audit --url
Dotyczy plików
page
Ten sam problem w
Lighthouse legacy-javascript-insight
Uczy jej skill
fe-perf-delivery JavaScript, CSS and asset delivery
Od wersji
0.1.0

Plik reguły na GitHubie

Przeczytaj w terminalu

npx github:dawidolko/frontend-skills explain perf/no-legacy-javascript