Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS file imports are appearing above banner section #21

Closed
MTG2000 opened this issue Apr 26, 2024 · 5 comments
Closed

CSS file imports are appearing above banner section #21

MTG2000 opened this issue Apr 26, 2024 · 5 comments
Assignees

Comments

@MTG2000
Copy link

MTG2000 commented Apr 26, 2024

Hi
So I'm using this library in building a React library that is supposed to work in Next.js.
As you know in Next.js 13+, you need to have a "use client"; directive at the top of each component file.

This is usually achieved in vite by adding the "use client"; directive as a banner.
But this library puts the css imports at the top of the file, so the directives are not working.

Is there a way to make the css imports appear after the banner?
Or should I be tackling this issue using something other than banners completely??

Thanks for your help.

@emosheeep
Copy link
Owner

emosheeep commented Apr 26, 2024

Yes, I was about to do it originally as what your said. For now this plugin just adds a line and is not using AST analysis. The CSS injection supposes to be put at the end of the import statement blocks. But I have no time to work on this these days, maybe someone can pull a request? 😄 It's simple.

@emosheeep
Copy link
Owner

Maybe I can have it done in a certain weekend in the future.

@emosheeep
Copy link
Owner

I've published 2.1.0-beta.0, you can have a try.

@MTG2000
Copy link
Author

MTG2000 commented Apr 26, 2024

Hey @emosheeep
Thanks a lot for the quick update!
I tried the new version, & it's working 👌

@emosheeep emosheeep self-assigned this May 9, 2024
@emosheeep
Copy link
Owner

v2.1.0 has been published.

@emosheeep emosheeep pinned this issue May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants