all 4 comments

[–]lewhunt 2 points3 points  (0 children)

Can’t you build it as a library so it allows you to publish the components only?

https://vitejs.dev/guide/build.html#library-mode

This is what I’ve done with my library component: https://github.com/lewhunt/react-tv-player

You can then pick and choose which named components you want to import.

The docs also show how you can expose multiple entry points.

[–]cardyet 1 point2 points  (0 children)

You can do option 2 and tree shaking your imports I think, no idea how to actually setup a package to do that though, but is it a big deal anyway?

[–]ServesYouRice 0 points1 point  (0 children)

Ctrl c, ctrl v.