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.
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:
If you are using Angular CLI, include source maps in your production build to inspect your bundles.
React.lazy(). Otherwise, code-split using a third-party library such as loadable-components.