This repository was archived by the owner on Jun 22, 2025. It is now read-only.
This repository was archived by the owner on Jun 22, 2025. It is now read-only.
Tree shaking of debug code? #34
Open
Description
I noticed that the DebugLayerMaterial
code adds ~50KB gzipped to my production js bundle even if I'm not using the debug layer. Looks like the main reason is because it's importing leva
and its dependencies. I think this is something like an extra 2-3x the size of lamina's core code.
Tested with webpack and vite, but it's possible this is just my setup. I did a hacky fix with my bundler to alias leva
to an empty exports file in production, but it would be nice to have the debug code automatically excluded if unused.
(Also, love the library!)