Tree Shaking Three.js

Well as I see it, the most of it already is tree-shakable, you can get bundle sizes (three + etc.) below 300 KB transferred over network and that’s a single high-quality JPEG, so I’m pretty satisfied with that :man_shrugging: Just import from ‘src’ and move example-based modules to ‘src’ if you need them.

Switching to Node-based materials would be cool for several other reasons, but tree-shaking? :thinking:
I just tested adding MeshStandardMaterial to my simple example above, it added only 5K (unminified / uncompressed) to the bundle.

1 Like