nextui-org / tailwind-variants

🦄 Tailwindcss first-class variant API
https://tailwind-variants.org
MIT License
2.1k stars 63 forks source link

WithTV crashes when bundling with Rollup and TSDX #196

Open ferranrt opened 1 month ago

ferranrt commented 1 month ago

Describe the bug I'm building a large-scale project that uses TailwindCSS as styling engine. Few months ago I discovered tailwind-variants whichs works very well for me. Now that my project has scaled quite a lot, I want to create and split some libraries to provide all de "frontend clients" the methods and components to build the UI. More specifically:

The problem is related with "withTV" functionality. That functionality uses internal methods of NODEJS like "fs" or "paths" functions that when I try to bundle the package (I'm creating my libraries with TSDX / Rollup) are not bundled or simply gives me an error like

Can't resolve 'fs'

Has someone faced with an issue like this? Is there a better approach to achieve the "architecture" I've described to build a large component library like that?

Additional context The main goal is to have a "single source of truth" about styling and methods and styling and then be able to create packages related and linked to that source of truth.

Thank you!

sushanyadav commented 1 month ago

+1