#yarn pnp

6 messages · Page 1 of 1 (latest)

oblique depot
#

Just trying out flowbite in my vanilla NextJS project, and I ran into a problem with configuring tailwind to compile the dynamic classes from the library when I'm using yarn PnP. With PnP, there aren't any files in node_modules anymore, they're zips in yarn's PnP cache directory, so the direction to add "./node_modules/flowbite-react/**/*.js" is incorrect. I got over the issue running yarn config set nodeLinker node-modules so yarn would create links in a node_modules directory, but it took a bit to figure out.

My question: Is there a better way to use flowbite with yarn PnP other than calling yarn config set nodeLinker node-modules. If there isn't, may i suggest the documentation get updated calling this out?

twin owl
#

Hmm...

#

That's a good question I don't know the answer to. So, FYI, just starting with why that line is in the config in the first place. Tailwind CSS decides when you run a build which class names to actually include in its output CSS. If you don't have flowbite-react's output folder in there, well, it's not going to pick up any class names that are ONLY used in the library. Ergo, you may or may not have some classes just... disappear

#

I'm not sure WTF to do with yarn pnp. I haven't used that before but I understand the behavior you are describing

#

@oblique depot My inclination would be that Tailwind CSS as a whole probably doesn't work with Yarn PnP but TBH I can't really find a decisive answer on google search. Let me know if it is working for you and maybe we can figure this out on flowbite's end

oblique depot
#

Tailwindcss is working fine with Yarn PnP. Yarn handles resolving paths and such.