Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuild

Đang mở
#34,446 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@MeAkib đang làm issue này rồi.

Từ ngày 20/10/2026.

  • #34451 của @MeAkib — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
angular, node.js, tailwindcss, typescript
Lĩnh vực
build-system, devtools

Hướng nghiên cứu

Start with src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js, where PostCSS directory dependency messages are expanded and existing files are added to watchFiles. Trace how esbuild receives watch dependencies and how file add, unlink, or rename events are handled. Done means the reproduction generates classes for newly created or moved source files on the next rebuild; an open linked pull request indicates work is already underway.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area: @angular/build
Command

build

Is this a regression?
  • Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was

No response

Description

In @angular/build 22.2.2 (and 22.2.3), src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js handles PostCSS dir-dependency messages by expanding the glob with tinyglobby and adding the resulting files to watchFiles. Only files that exist at build time are watched. A file created later, or moved by renaming its folder, is never watched, so classes used only in it are not generated until something else triggers a stylesheet rebuild. esbuild has no directory/glob watch to fall back on, so the dir itself should probably be watched (or the glob re-expanded on add/unlink events).

Minimal Reproduction
  1. Angular 22 app with Tailwind v4 via @tailwindcss/postcss; run ng serve.
  2. Create src/app/foo/foo.ts using a class not used elsewhere, e.g. bg-[#123456]. It is generated.
  3. Rename the folder to src/app/bar/ and edit the file to use bg-[#654321]. The class is not generated.
  4. Touch src/styles.css. Now it is generated.

NG_BUILD_WATCH_ROOT=1 stops detecting changes entirely. Polling ("poll": 1000) doesn't help either.

Exception or Error
Classes in files added or moved under Tailwind's sources are generated on the next rebuild, as with modifications.
Your Environment
_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI       : 22.2.0
Angular           : 22.2.0
Node.js           : 24.15.0
Package Manager   : bun 1.4.2
Operating System  : linux x64

┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package                   │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/aria             │ 22.2.0            │ 22.2.0            │
│ @angular/build            │ 22.2.0            │ 22.2.0            │
│ @angular/cdk              │ 22.2.0            │ 22.2.0            │
│ @angular/cli              │ 22.2.0            │ 22.2.0            │
│ @angular/common           │ 22.2.0            │ 22.2.0            │
│ @angular/compiler         │ 22.2.0            │ 22.2.0            │
│ @angular/compiler-cli     │ 22.2.0            │ 22.2.0            │
│ @angular/core             │ 22.2.0            │ 22.2.0            │
│ @angular/material         │ 22.2.0            │ 22.2.0            │
│ @angular/platform-browser │ 22.2.0            │ 22.2.0            │
│ @angular/platform-server  │ 22.2.0            │ 22.2.0            │
│ @angular/router           │ 22.2.0            │ 22.2.0            │
│ @angular/ssr              │ 22.2.0            │ 22.2.0            │
│ rxjs                      │ 7.8.2             │ ^7.8.2            │
│ typescript                │ 6.0.2             │ 6.0.2             │
│ vitest                    │ 4.1.11            │ 4.1.11            │
Anything else relevant?

No response

Ngôn ngữ chính
TypeScript
Star
27k
Fork
11.8k
Merge trung bình
1 ngày 7 giờ
Pull request đã merge (30 ngày)
258

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của angular/angular-cli

Tất cả issue của angular/angular-cli

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.