Next.js Discord

Discord Forum

Next.js Component Library - Client Components in own chunks even when imported in Server Component?

Unanswered
Australian Freshwater Crocodile posted this in #help-forum
Open in Discord
Australian Freshwater CrocodileOP
Anyone know how to set this up with Rollup? Looks like have to disable code splitting.

1) Anything with use client; is its file.
2) Find a way to detect if imports in a Server component contain use client. If so, do not bundle client component code into server component. Should reference separate chunk.

I gotta say, this whole paradigm of client and server component is an absolute nightmare for library authors.

0 Replies