Next.js Discord

Discord Forum

How to avoid multiple export in packages.json in packages with turborepo

Unanswered
Silky ant posted this in #help-forum
Open in Discord
Silky antOP
how to avoid this?

8 Replies

Asian black bear
You could technically just export everything, but that's not as granular and can expose certain modules you want to keep private.
@Asian black bear You could technically just export everything, but that's not as granular and can expose certain modules you want to keep private.
Silky antOP
Is there a simpler way to do it, without having to write each export one by one?
Asian black bear
You can just consolidate them mapping "./*" onto "./*.ts".
@Asian black bear You can just consolidate them mapping `"./*"` onto `"./*.ts"`.
Silky antOP
I guess I'll need to put an index.ts file in each subfolder and export it from the parent as well ?
Asian black bear
Barrel files shouldn't be necessary. The simple * glob should suffice to cover everything out of the box.
Not 100% though.
Silky antOP
I'll give it a try, thanks!
Silky antOP
didn't work :/