Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuild
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- angular, node.js, tailwindcss, typescript
- 领域
- build-system, devtools
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- Angular 22 app with Tailwind v4 via @tailwindcss/postcss; run ng serve.
- Create src/app/foo/foo.ts using a class not used elsewhere, e.g. bg-[#123456]. It is generated.
- Rename the folder to src/app/bar/ and edit the file to use bg-[#654321]. The class is not generated.
- 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
- 主要语言
- TypeScript
- 星标
- 27k
- 派生
- 11.8k
- 平均合并
- 1 天 6 小时
- 30 天内合并 PR
- 224
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
angular/angular-cli 的其他 Issue
-
area: @angular/build gemini-triaged
难度 2/5 1-3 小时 新手友好度 74/100
angular/angular-cli#33955 ·
维护者通常 1 天内回复
-
area: @angular/cli gemini-triaged
难度 2/5 1-3 小时 新手友好度 72/100
angular/angular-cli#33055 · 1 条评论 · 3 个 reaction ·
维护者通常 1 天内回复
-
Angular SSR Unescaped prerender parameters enable RCE through generated manifests and XSS in redirect pages可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area: @angular/ssr
难度 4/5 3-5 天 新手友好度 53/100
angular/angular-cli#34474 ·
维护者通常 1 天内回复
-
`ng generate app-shell` and `ng generate module --route` produce broken imports when a component `type` is configured可能已有人在做 @MeAkib 于 2 天前认领。 未关闭area: @schematics/angular
难度 3/5 1-2 天 新手友好度 35/100
angular/angular-cli#34449 ·
维护者通常 1 天内回复
-
unit-test builder (Vitest): key `fsModuleCache` on the served build output instead of forcing it off可能已有人在做 @jv3n 于 2 天前认领。 未关闭area: @angular/build
难度 4/5 3-5 天 新手友好度 20/100
angular/angular-cli#34443 ·
维护者通常 1 天内回复
查看 angular/angular-cli 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
cloudscape-design/components#5184 ·
维护者通常 2 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 75/100
JarX-Concepts/react-native-platform-components#130 ·
维护者通常 1 天内回复
-
fix(api): optimize-for-web /preview outer catches miss asDecoderOutOfMemory on V8 OOM and SIGKILL未关闭area: backend bug priority: low
难度 2/5 1-3 小时 新手友好度 83/100
snapotter-hq/SnapOtter#3773 ·
维护者通常 1 天内回复
-
ai-driven-qa ux-audit
难度 2/5 1-3 小时 新手友好度 78/100
linagora/twake-contacts-frontend#386 ·
维护者通常 1 天内回复
-
git: README should state plainly that without --repository every reachable repository is in scope未关闭documentation server-git v2
难度 1/5 1-3 小时 新手友好度 84/100
modelcontextprotocol/servers#5225 ·
维护者通常 1 天内回复