pmndrs / react-three-fiber

🇨🇭 A React renderer for Three.js
https://docs.pmnd.rs/react-three-fiber
MIT License
27.62k stars 1.6k forks source link

Support Three.js tree-shaking when using hooks #3296

Closed pedroalmeida415 closed 5 months ago

pedroalmeida415 commented 5 months ago

import * as THREE from 'three' makes it impossible to do tree-shaking on the Three.js package.

CodyJasonBennett commented 5 months ago

This is untrue -- bundlers can evaluate namespaces, and we use that for type information only.

Also see https://docs.pmnd.rs/react-three-fiber/api/canvas#tree-shaking.

pedroalmeida415 commented 4 months ago

You're right! The problem was actually in the analyzing tool I was using.

Thanks for clarifying!