Skip to content

@source Not Working as Expected During Build Process #17601

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

Open
mafifi opened this issue Apr 7, 2025 · 4 comments
Open

@source Not Working as Expected During Build Process #17601

mafifi opened this issue Apr 7, 2025 · 4 comments

Comments

@mafifi
Copy link

mafifi commented Apr 7, 2025

What version of Tailwind CSS are you using?

For example: v4.1.3

What build tool (or framework if it abstracts the build tool) are you using?

Vite 6.2.5

What version of Node.js are you using?

v20.18.1

What browser are you using?

Edge 135.0.3179.54

What operating system are you using?

mac OS 15.4

Reproduction URL

https://github.com/mafifi/monorepo

Describe your issue

Try running laifu-nini in preview, this will look visually correct.
Edit the app.css file inside laifu-nini and edit

@source '../../../packages/ui/src/lib/components/ui/button/*.svelte';

to

@source '../../../packages/ui/src/lib/components/ui/*/*.svelte';

This will break visually.

There appears to be an inherit limit on the number of files / directories, @source will accept.

@mafifi
Copy link
Author

mafifi commented Apr 8, 2025

Trying to debug this to identify where the issue is in tailwind.

Much easier to reproduce with the cli.

cd apps/laifu-nini && npx @tailwindcss/cli --input src/app.css --optimize | grep oklch

This will work, and include the classes that are needed by shadcn in the packages/ui

cd apps/laifu-nini && npx @tailwindcss/cli --input src/app.css --cwd ../../packages/ui --optimize | grep oklch

This will not work, and shake out classes that are used!

So it looks @source is working, but somehow --optimize doesn't respect it?

@Roene-JustBetter
Copy link

I have the same issue.
When I add this in my app.css:
@source "../../vendor/rapidez/account/resources/views/account/**/*.blade.php";
Everything works fine.

When I change it to this:
@source "../../vendor/rapidez/*/resources/views/account/**/*.blade.php";
The styling doesn't work.

@hamidrezahanafi
Copy link

hamidrezahanafi commented Apr 21, 2025

I have the similar issue with tailwind @source and a large codebase but only when using Turbopack, it's not happening with Webpack, In my case it just hang in Compiling ...
I enabled DEBUG=1 and it got stuck in following section

Image

@hamidrezahanafi
Copy link

I could reproduce it with Turbopack and NextJS in a vanilla app
Created the issue on NextJS repo, please upvote if you have similar issue
vercel/next.js#78407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants