Replies: 1 comment 2 replies
-
I'm currently facing this exact situation, i'm using my component with the corresponding class generated but no styles are being applied. I don't know where exactly reference the generated css file to be able to apply the styles. Did you find any solution for this? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building a library of reusable React components using Vite's library mode and I'm encountering some issues. Basically when I import my components in a consumer React app I'm missing the relative CSS files. The className generated by vanilla is there, but the browser does not find any stylesheet containing rules for that selector.
For example let's say this is my component:
And this is its
styles.css.ts
file:The component is then exported by my
lib/main.ts
file:When I build the project in the
dist
folder I can see thestyle.css
file with the class and its associated properties. Only, it seems it's linked nowhere in the.es.js
file outputted by the build process.What am I doing wrong? 😐
This is my vite config:
Beta Was this translation helpful? Give feedback.
All reactions