Bloated js file

Three.js as a library is over 500Kb, and it’s being bundled together with the rest of your JS. Just because your code is very small, it doesn’t mean that all the required code to display a GLTF model also has to be small.

There have been many attempts at only importing the parts of Three.js that you’re using, but the consensus is that as it’s currently written, the library will always import in full.

There are efforts underway to improve “tree-shakeability” in the future. That being said, the 244Kb recommended size limit is pretty arbitrary, and you can change it in your bundler settings. It would be impossible to do what you’re doing in under 244Kb. Maybe you could try gzipping or minifying your code?

1 Like