I have a webapp that is intended for mobile.
I ran Chrome devtools Audit on it with settings: Mobile and Simulated Slow 4G, 4x CPU Slowdown
The Performance is poor - specifically the measure First Contentful Paint
The first suggestion in the Opportunities section is to Eliminate render-blocking resources
One of the main js files that takes time to load is threejs, which is required for the first page, so it is in the critical path.
If I add defer to when loading the script, I get errors while loading the first page.
I am already using the minified version three.min.js and also serving it compressed with gzipped (as well as other .js, .html, .css files).
The coverage section shows that only a small part of three.js is used (as expected).
Is there a way to break the file three.js into smaller pieces, and load only the code that is in the critical path?
How can I farther optimize the load of the three.js file?