Building component library with nest folder structure using vite

I would like to build a a component library using vite.

But i do not want a single entry point, I want to produce nested folder structure similar to for example MUI. So that components can be imported

import MyComponent form 'library/foo/MyComponent'

as opposed having one massive index file with everytinh or having to do something like

import { foo } form 'library'
const { MyComponent } = foo

as I said, I would like folder structure, not a single compiled file. Similary to what mui does.

I have spend couple hours searching with no success, I only fond ‘vite-plugin-static-copy’ but that can not be used for source as it does not resolve aliases.