Poor page performance due to unused JavaScript

Does anyone know how to remove unused JavaScript when deploying a Dash app on the web?

My app is running on a gunicorn web server with render.com as my paas. The first image shows the app’s code which is just the basic example taken from Dash documentation. The second image is from lighthouse.

So I did a bit more digging and found that you can load partial bundles instead of the whole plotly.js file.

Doing the above improves the page’s performance. I’ll leave the reference below: