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
Currently I'm doing this for myself in every project that uses shadcn, but I think it would be nice for everyone. So my $lib/components/ui/index.ts basically looks like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Currently I'm doing this for myself in every project that uses shadcn, but I think it would be nice for everyone. So my
$lib/components/ui/index.ts
basically looks like this:So in my components I can write:
Or since I've set up an extra alias I can write:
Or since Vite is actually quite smart with their treeshaking, I can now even do:
And Vite will properly tree-shake the UI components so the build-files never contain more code than they need to.
Beta Was this translation helpful? Give feedback.
All reactions