-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
v4: Automatic content detection in monorepos only finds direct package #13136
Comments
Hi! I'm using NX monorepo, same problem. If we have structure like:
All components will not have correct css output. Found some hack, using tailwindcss 4.0.0-alpha.8.
And it's ok for now. Good job on new Tailwind v4, love it! |
When using workspaces and changing the base directory to the root of the project, I started getting the following error:
That appears to be coming from
After removing that file, I got the same error for
It doesn't look like there's a way to make this work today. Eventually, I think the approach would be to customize the excluded content directories in oxide. It may make sense to exclude node_modules by default too, allowing for opt-in for that instead of opt-out like the
In the meantime, the only solution I could come up with was to manually delete the errant files using some RUN commands in my Docker image. This could also work as a postinstall script in the package.json for those not using Docker.
Storybook is only removed here because it nests commander as well. |
I'm using turborepo and was able to fix this issue by using the new @source at-rule introduced in 4.0.0-alpha.19 Here's what my project structure looks like: / (root)
├── apps
│ └── dashboard
│ └── app
│ └── globals.css
└── packages
└── ui
└── styles
└── tailwind.css In my ui package, I have my default tailwind styles in tailwind.css: @import 'tailwindcss'
@theme {
/* Your default styles here */
} Then in my dashboard app, I import that default tailwind.css and also specify content locations @import '@lydar/ui/tailwind.css';
@source "../app/**/*.{ts,tsx}"; /* Current app */
@source "../../../packages/ui/**/*.{ts,tsx}"; /* Any components in ui package*/
/* Any other app specific styling you want to do here*/ |
What version of Tailwind CSS are you using?
4.0.0-alpha.6
What build tool (or framework if it abstracts the build tool) are you using?
"next": "^14.1.1"
"@tailwindcss/postcss": "^4.0.0-alpha.6",
"postcss": "^8.4.35",
What version of Node.js are you using?
v18.18.2
What browser are you using?
N/A
What operating system are you using?
macOS
Reproduction URL
Attempting to do this inside an existing project, feel free to request a reproduction if you feel it will help and I'll make one (just takes a good chunk of time so wanted to check this level of detail was required first).
Describe your issue
I'm using tailwind in a mono repo, there is a basic design system which is just a bunch of components with tailwind classes and some config for styles (e.g.
bg-primary
). Upgrading to v4 was seamless for this, we were able to build and publish the design system.When using the design system in the monorepo in a Next.js project we're transpiling the components (rather than using the built version).
I noticed that the styles were not being generated, I assumed this was because the automatic detection was not picking it up. Looking at the config code, it seems like we should be passing through the
base
as the config variable based on the config:At first I tried putting in
"../.."
so that it would map to a relative root directory, but it seems like the only way to use base is with an absolute path eg `"/Users/me/Code/monorepo/" which does work.It would just be nice to be able to use a relative directory here so that when we look at deploying/cloning the repo it's not hard coded to a user directory.
I imagine this might be solved when:
So feel free to also close this and I can be patient 😅
The text was updated successfully, but these errors were encountered: