Skip to content

[v4] Tailwind CLI ignores .gitignore in watch mode #15684

@condemil

Description

@condemil

What version of Tailwind CSS are you using?

v4.0.0-beta.9

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

@tailwindcss/[email protected]

What version of Node.js are you using?

$ node --version
v23.5.0

What browser are you using?

N/A

What operating system are you using?

macOS

Reproduction URL

git clone https://gist.github.com/condemil/b9990c17d419a0d9d1f0cc0f637fdb3c tw4-watch-gitignore-repro

Describe your issue

When tailwindcss cli is running in watch mode and ignored file is modified the output will contain css from the ignored file:

To reproduce:

  1. Run the tailwindcss cli in watch mode
$ DEBUG=1 npx @tailwindcss/[email protected] -i input.css -o output.css -w
≈ tailwindcss v4.0.0-beta.9

Done in 35ms

[36.26ms] [@tailwindcss/cli] (initial build)
[ 9.24ms]   ↳ Setup compiler
[ 7.97ms]   ↳ Scan for candidates
[10.85ms]   ↳ Build CSS
[ 1.84ms]   ↳ Write output
  1. Check that output.css doesn't have h-100
$ cat output.css | grep h-1
$
  1. Modify test.go and observe tailwindcss cli log
Done in 11ms

[11.25ms] [@tailwindcss/cli] (watcher)
[ 1.66ms]   ↳ Scan for candidates
[ 7.72ms]   ↳ Build CSS
[ 1.64ms]   ↳ Write output
  1. Check that output.css now have h-100
$ cat output.css | grep h-1
  .h-100 {

Metadata

Metadata

Assignees

No one assigned

    Labels

    oxideIssues affecting file parsing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions