Replies: 2 comments 1 reply
-
Currently, there's not a precise way to preserve the directive. Using `banner (https://lib.rsbuild.dev/config/lib/banner) may works but it's will add banner to all files. This issue is similar to #166. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for reporting. Let's track it in the new issue (#381). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I want to use rslib to create a component library which supports server components, how can I preserve the
"use client"
directive at the top of the file?I have a pretty basic config:
But my output for a simple client components winds up looking like this:
If
"use client";
isn't the first line in the component definition, it's an invalid client component. If I manually move the directive to the top of the file before packing & installing in my consuming app, it works fine. Is there some config options or plugins that exist today to help solve this, or is this currently unsupported?Beta Was this translation helpful? Give feedback.
All reactions