You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.
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!)
The text was updated successfully, but these errors were encountered:
I'm not too familiear with tree shaking but in the next release 1.2.0 the debugger will be broken off into lamina/debug. Correct me if i'm wrong but that should mean that as long as lamina/debug is not imported, Leva will not end up in the bundle.
You can follow the progress of 1.2.0 in #29 however beware, its an in-dev branch and quite a lot might be broken up till release
Yeah sounds like that'll work. I was going to suggest an experience like react query's devtools, which conditionally imports the module depending on the NODE_ENV, but realize there's probably use cases to intentionally ship the lamina debugger.
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 importingleva
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!)
The text was updated successfully, but these errors were encountered: