I successfully put some ShadCN components in a Vite project, but styles are not applied when i try to consume it as an NPM package #1327
Unanswered
Jared-Dahlke
asked this question in
Q&A
Replies: 2 comments
-
index.ts
package.json
Usage in other app
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello - reviving an old thread - are there any guidelines in regards to how to achieve this in 2025? Also tagging @Jared-Dahlke - was this your final decision or did you come up with another workaround? |
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
THANK YOU for the awesome work. THis is amazing.
I built a Vite project and added a handful of ShadCN components. When I run it locally in the App.tsx of the same repo it looks perfect.
Now I have setup the project to be an NPM package.
But when I try to consume the NPM package the styling is not being applied. I want to be able to consume the package from other react apps that do not have tailwind installed.
How can I do this? Is there a good example? I am using the exact same configuration I am using for another NPM package I have that works perfectly (but it doesnt use tailwind or postcss)
here are are the relevant files from the npm package. I am also happy to create minimal reproducible example if I need to
vite.config.ts
tsconfig.json:
tailwind.config.js
postcss.config.cjs
package.json
index.ts:
Beta Was this translation helpful? Give feedback.
All reactions