Write to log file when using DEBUG=*#17906
Merged
RobinMalfait merged 8 commits intomainfrom May 7, 2025
Merged
Conversation
b40a683 to
1fe008d
Compare
This log happens when we are traversing using the gitignore walker
DEBUG=*DEBUG=*
| - Don't scan files for utilities when using `@reference` ([#17836](https://github.com/tailwindlabs/tailwindcss/pull/17836)) | ||
| - Fix incorrectly replacing `_` with ` ` in arbitrary modifier shorthand `bg-red-500/(--my_opacity)` ([#17889](https://github.com/tailwindlabs/tailwindcss/pull/17889)) | ||
| - Upgrade: Bump dependendencies in parallel and make the upgrade faster ([#17898](https://github.com/tailwindlabs/tailwindcss/pull/17898)) | ||
| - Upgrade: Bump dependencies in parallel and make the upgrade faster ([#17898](https://github.com/tailwindlabs/tailwindcss/pull/17898)) |
This allows us to: 1. Only output the header once 2. Output a log from Oxide that will end up underneath the header
thecrypticace
approved these changes
May 7, 2025
|
Is there a way to debug the scanner with Vite? This here seems to be for Tailwind CLI only? |
Member
Author
|
@NickSdot |
You are right. Apparently I missed something this morning, my bad. Thanks for the quick answer! 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves the debugability of the scanner when using
DEBUG=*by writing to atailwindcss-{pid}.logfile in the current working directory.It will include all the tracing information from the scanner. This PR also introduces
Discovering {path}andReading {path}logs.Discovering {path}— this is logged when we are traversing the file system looking for files. We use theignorecrate, and log this information in thefilter_entrycallback. If a file was already ignored by.gitignorefiles, this won't show up, but it also means that we will not read it.Reading {path}— this is when we are actually reading the file so we can start extracting potential Tailwind CSS classes.These will give you some insights in what paths are being scanned, and if we get stuck, where we get stuck.
Also, we are appending to the file. In the log below, you can already see that a
tailwindcss-<number>.logfile exists already even though it didn't exist before running the command. This should make it easier to debug if we get stuck on a specific file/folder because the file will be populated with information.There are a few reasons for appending to a file:
@sourcedirectives, you could diff the outputs. (although, the timestamps will be different)DEBUG=*, a lot of other tools also output debug information, so writing to a file should make this better.Example log
We also output where we are writing the file to. This looks like this when using the CLI:

Last but not least, this also ignores
.logfiles by defaultTest plan
Ran the CLI (but you can use any tool real, since this is implemented in Oxide) with the
DEBUG=*flag.The file generated, looks like the example I shared above.