Skip to content

CLI watch does not rebuild when a tracked dependency is deleted #20113

@fallintoplace

Description

@fallintoplace

What version of Tailwind CSS are you using?

v4.3.0

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

@tailwindcss/cli v4.3.0

What version of Node.js are you using?

v24.15.0

What browser are you using?

N/A

What operating system are you using?

macOS

Reproduction URL

N/A (fresh-project reproduction steps below)

Describe your issue

If a file in the CLI watcher's tracked full-rebuild dependency set is deleted, the watcher does not trigger a full rebuild.

I can reproduce this with a config dependency:

  1. Create these files in a fresh project:

package.json

{
  "private": true,
  "dependencies": {
    "tailwindcss": "4.3.0",
    "@tailwindcss/cli": "4.3.0"
  }
}

tailwind.config.js

const myColor = require('./my-color')
module.exports = {
  theme: {
    extend: {
      colors: {
        primary: myColor,
      },
    },
  },
}

my-color.js

module.exports = 'blue'

src/index.css

@import 'tailwindcss';
@config '../tailwind.config.js';

index.html

<div class="text-primary"></div>
  1. Install dependencies.
  2. Run:
pnpm tailwindcss --input src/index.css --output dist/out.css --watch
  1. Delete my-color.js.

Expected behavior:

  • the watcher should trigger a full rebuild because my-color.js is a tracked rebuild dependency
  • the rebuild should surface the missing dependency error instead of silently keeping stale state

Actual behavior:

  • no rebuild is triggered on delete
  • the previous CSS output stays in place until some other tracked full-rebuild file changes

This seems to happen because delete events are dropped before the watcher checks whether the deleted path is in the full rebuild dependency set.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions