tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Include glob path fails when path is also gitignored

Open SanderFlooris opened this issue 3 months ago • 3 comments

What version of Tailwind CSS are you using?

v4.1.12

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

Vite (6.2.1)

What version of Node.js are you using?

v22.19.0

What browser are you using?

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:142.0) Gecko/20100101 Firefox/142.0

What operating system are you using?

macOS Sequoia 15.6.1

Reproduction URL

https://github.com/SanderFlooris/tailwind-4-gitignore-testcase

Instructions on how to configure the repository and how to trigger the bug has been provided in the README.

[!NOTE] This example repository uses Express.js as the back-end for simplicity, the actual project we are working on is based on Laravel.

Describe your issue

In a project we are working on we prerender some parts of the page as static HTML files, these HTML files will then dynamically be loaded in our templates to cache sections of the webpage, without caching everything.

However we discovered that Tailwind doesn't seem to pick up the classes properly inside of our cms_content directory that contains the prerendered sections, even though we manually specify in our Tailwind configuration that that directory should be scanned.

After some digging around we figured out it was caused by the directory being gitignored, and we are unable to overwrite this. The compiler just skips over the directory entirely when we checked with DEBUG=* yarn dev.

SanderFlooris avatar Sep 03 '25 14:09 SanderFlooris

@minseonkkim I tried your suggestion, but it doesn't seem to resolve the issue.

I also searched for TAILWIND_DISABLE_GITIGNORE and DISABLE_GITIGNORE with Google and inside the tailwindlabs GitHub organization, but there are no matches. Are you sure the environment variable name is correct? 🤔

Image Image Image

SanderFlooris avatar Sep 08 '25 13:09 SanderFlooris

Not sure where @minseonkkim got that information from because TAILWIND_DISABLE_GITIGNORE doesn't exist. Sounds like LLM hallucinations.

RobinMalfait avatar Sep 09 '25 09:09 RobinMalfait

I guess so, since he also removed his comment. 🤔

SanderFlooris avatar Sep 09 '25 11:09 SanderFlooris