export part of app as NPM module
Unanswered
Purple Martin posted this in #help-forum
Purple MartinOP
I'm working on a design system app. I used next.js as foundation, so that I could use next/image and next/link.
My components are stored in src/components, and are created using Shadcn/ui, while my app lives in src/app
What I'd like to do is to turn this next.js app as a NPM module which sole purpose is to export these components, so that I could import them in other next.js apps.
Unfortunately, it appears that the next build command does not export my components directory, which means I'll probably have to use a custom build to bundle and export my components.
Has anyone done this before ? If so, I'd really like a helping hand to understand how 🙂
My components are stored in src/components, and are created using Shadcn/ui, while my app lives in src/app
What I'd like to do is to turn this next.js app as a NPM module which sole purpose is to export these components, so that I could import them in other next.js apps.
Unfortunately, it appears that the next build command does not export my components directory, which means I'll probably have to use a custom build to bundle and export my components.
Has anyone done this before ? If so, I'd really like a helping hand to understand how 🙂