-
Notifications
You must be signed in to change notification settings - Fork 185
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
Default config should not watch log
directory (and probably others)
#491
Comments
@alexandergitter Thanks for opening this issue, sorry you're experiencing that. I can't reproduce what you're seeing, though! Tailwind v4 has some heuristics for what files it chooses to scan:
Notably I'll quote from that section:
By default Rails include Any additional information you can provide me so that I can reproduce what you're seeing would be valuable |
I think this is a configuration issue. v4 dropped the configuration file ( Indeed, if I But you can fix that by doing:
See registering sources. this will only watch the app directory. |
@patriciomacadden I think we posted at the same time. Please see my comment above about how the v4 cli chooses to ignore files, it does not scan everything. |
🤔 Ok, I think I know what's going on here. When you echo something into "log/development.log" you see a line from the tailwindcss process But the CSS files are not being regenerated when this happens. You can demonstrate this by deleting I think the "Done in Xms" message is saying that a file changed on disk, not that the CSS file has been regenerated. In any case, this gem doesn't have control over what the upstream tailwindcss CLI executable emits, unfortunately. You may want to open an issue upstream? Closing because I don't think there's a specific config change I can (or should) make here. |
@patriciomacadden If you think changing the config to I'm not at all sure that limiting tailwind to the |
Ah, hmm, this looks like it's a bug in upstream in any case: tailwindlabs/tailwindcss#15684 |
I don't think it's necessary right now. It's not building the css and it's not spending a lot of time doing what it does. Even though we could add other directories using All good for me. |
Thank you both, I'll keep an eye on the upstream issue. |
I’d like to point out that while Tailwind v4 might not change the generated output and is rather quick in doing so, this behavior is still an issue overall because it causes a lot of CPU load. In my case, I use |
I noticed that on a new Rails app, Tailwind seems to be running quite frequently during HTTP requests, even if no files have changed. It appears that Tailwind watches the log files, where new log lines get appended frequently.
To reproduce this I'm doing the following:
rails new MyApp --css tailwind
bin/dev
echo "foo" >> log/development.log
17:01:26 css.1 | Done in 3ms
It would be nice if the default generated configuration excludes the
log
directory and probably others liketmp
andstorage
.OS: Ubuntu 24.04
Ruby: 3.3.6
Rails: 8.0.1
tailwindcss-rails: 4.0.0
tailwindcss-ruby: 4.0.4
The text was updated successfully, but these errors were encountered: