DEV Community

Discussion on: Create a React component library with Vite and Typescript

Collapse
 
jurito profile image
jurito • Edited

GREAT article!
Just a question. With this approach, how would I implement a library with folders?

My target would be being able to do smth like:

import { component } from 'mylibrary/folder';
import { othercomponent } from 'mylibrary/otherfolder';

Enter fullscreen mode Exit fullscreen mode
Collapse
 
nicolaserny profile image
Nicolas Erny

Thanks 🙏
I think I found the solution in the vitejs documentation: vitejs.dev/guide/build.html#librar...
You can define multiple entry points in the Vite config and expose them with folders (package.json).