Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add better messages around using Flowbite in monorepos #1454

Open
2 tasks done
mridang opened this issue Jul 26, 2024 · 1 comment
Open
2 tasks done

Add better messages around using Flowbite in monorepos #1454

mridang opened this issue Jul 26, 2024 · 1 comment
Labels
📚 documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@mridang
Copy link

mridang commented Jul 26, 2024

  • I have searched the Issues to see if this bug has already been reported
  • I have tested the latest version

Summary

When a CRA project using Flowbite is used in a monorepo setup e.g. NPM workspaces, the flowbite-react and flowbite packages get hoisted to the top-level node_modules folder. While the build (via npm run build), works as expected, the resultant CSS artifacts don't contain all the CSS.

This is documented in the library but requires a deep understanding of the CRA configuration to figure this out.

I suggest that better warnings be emitted or a exception be thrown if the required directory is missing.

/**
* Path to `node_modules` where `flowbite-react` is installed
*
* ===============================================
*
* For monorepo setup where `flowbite-react` is installed in the root `node_modules` but used in `apps/web` directory
* @example
* ```
* // tailwind.config.(js|cjs|mjs) file
*
* // cjs
* const flowbite = require("flowbite-react/tailwind");
* // esm
* import flowbite from "flowbite-react/tailwind";
*
* {
* content: [
* // ...
* flowbite.content({ base: "../../" })
* ],
* plugins: [
* // ...
* flowbite.plugin()
* ]
* }
* ```
*
* @default "./"
*/

Context

I was trying to use React + Flowbite + Tailwind (using CRA) in a package which is a part of a NPM monorepo

@SutuSebastian
Copy link
Collaborator

That makes sense, I agree with ur suggestion.

I guess a section in the guides/create-react-app would also make sense here.

@rluders rluders added 📚 documentation Improvements or additions to documentation good first issue Good for newcomers labels Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants