Integrating Nativewind in an npm Package #801
Replies: 1 comment 2 replies
-
I guess your problem is the missing extraction of tailwind classes you are using in your components (into the using project). If this is your problem, you just have to make sure, all tailwind classes that your package uses are somehow "visible" to the tailwind used in the dependent project. One solution to that would be to add the path to your npm packaged components to the The first one is easier to maintain, but might feel strange. The later requires to do manual bookkeeping of the used classes, or do extraction at build time and generate a plugin out of the result. |
Beta Was this translation helpful? Give feedback.
-
I'm developing an npm package with components styled using Nativewind. However, I've encountered challenges ensuring the styles apply when the package is imported. Has anyone successfully embedded Nativewind styles directly within an npm package, allowing for the styled components to be used out-of-the-box? I'm looking for any type of solution.
Is it even possible? I can't seem to find any npm packages at all using Nativewind for styling.. @marklawlor
Beta Was this translation helpful? Give feedback.
All reactions