See the Lighthouse performance scoring post to learn how your page's overall performance score is calculated.
The Coverage tab in Chrome DevTools can give you a line-by-line breakdown of unused code.
Coverage class in Puppeteer can help you automate the
process of detecting unused code and extracting used code.
Build tool for support for removing unused code
Check out the following Tooling.Report tests to find out if your bundler supports features that make it easier to avoid or remove unused code:
- Source code for the Remove unused code audit
- Remove unused code
- Code Splitting
- Dead Code Elimination
- Dead Imported Code