Title: Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuild · Issue #34446 · angular/angular-cli · GitHub
Open Graph Title: Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuild · Issue #34446 · angular/angular-cli
X Title: Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuild · Issue #34446 · angular/angular-cli
Description: 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/style...
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/angular/angular-cli/issues/34446
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tailwind CSS v4 classes in new or moved files are not picked up by ng serve until another rebuild","articleBody":"### Command\n\nbuild\n\n### Is this a regression?\n\n- [ ] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n_No response_\n\n### Description\n\nIn @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).\n\n### Minimal Reproduction\n\n1. Angular 22 app with Tailwind v4 via @tailwindcss/postcss; run ng serve.\n2. Create src/app/foo/foo.ts using a class not used elsewhere, e.g. bg-[#123456]. It is generated.\n3. Rename the folder to src/app/bar/ and edit the file to use bg-[#654321]. The class is not generated.\n4. Touch src/styles.css. Now it is generated.\n\nNG_BUILD_WATCH_ROOT=1 stops detecting changes entirely. Polling (\"poll\": 1000) doesn't help either.\n\n### Exception or Error\n\n```text\nClasses in files added or moved under Tailwind's sources are generated on the next rebuild, as with modifications.\n```\n\n### Your Environment\n\n```text\n_ _ ____ _ ___\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\n / △ \\ | '_ \\ / _` | | | | |/ _` | '__| | | | | | |\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\n /_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\n |___/\n\n\nAngular CLI : 22.2.0\nAngular : 22.2.0\nNode.js : 24.15.0\nPackage Manager : bun 1.4.2\nOperating System : linux x64\n\n┌───────────────────────────┬───────────────────┬───────────────────┐\n│ Package │ Installed Version │ Requested Version │\n├───────────────────────────┼───────────────────┼───────────────────┤\n│ @angular/aria │ 22.2.0 │ 22.2.0 │\n│ @angular/build │ 22.2.0 │ 22.2.0 │\n│ @angular/cdk │ 22.2.0 │ 22.2.0 │\n│ @angular/cli │ 22.2.0 │ 22.2.0 │\n│ @angular/common │ 22.2.0 │ 22.2.0 │\n│ @angular/compiler │ 22.2.0 │ 22.2.0 │\n│ @angular/compiler-cli │ 22.2.0 │ 22.2.0 │\n│ @angular/core │ 22.2.0 │ 22.2.0 │\n│ @angular/material │ 22.2.0 │ 22.2.0 │\n│ @angular/platform-browser │ 22.2.0 │ 22.2.0 │\n│ @angular/platform-server │ 22.2.0 │ 22.2.0 │\n│ @angular/router │ 22.2.0 │ 22.2.0 │\n│ @angular/ssr │ 22.2.0 │ 22.2.0 │\n│ rxjs │ 7.8.2 │ ^7.8.2 │\n│ typescript │ 6.0.2 │ 6.0.2 │\n│ vitest │ 4.1.11 │ 4.1.11 │\n```\n\n### Anything else relevant?\n\n_No response_","author":{"url":"https://github.com/abrahamsaanchez","@type":"Person","name":"abrahamsaanchez"},"datePublished":"2026-10-20T16:04:12Z","url":"https://github.com/angular/angular-cli/issues/34446"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cdf1f854-68ff-dd9d-0d3f-44439e5b8923 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DDE8:36A3E:2E88D3A:3E159E0:6B01E028 |
| html-safe-nonce | 9fd3afbf17ecf4bceb1aca6419c45dc173ef838d48d0c29fe8b9561fdad5ba67 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEREU4OjM2QTNFOjJFODhEM0E6M0UxNTlFMDo2QjAxRTAyOCIsInZpc2l0b3JfaWQiOiI0MTQyMjg4MjA2OTI0MjEwMjE2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5f4f62d0bc57e09f363d9f75710f3b8d3770703eba65af86ff5aed46eb37a10f |
| hovercard-subject-tag | issue:5945106462 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/34446/issue_layout |
| twitter:image | https://opengraph.githubassets.com/29fa2cd74aa22b8163bac4caafc89c24ed7f6f112a0b9b163279e61923b0b0fc/angular/angular-cli/issues/34446 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/29fa2cd74aa22b8163bac4caafc89c24ed7f6f112a0b9b163279e61923b0b0fc/angular/angular-cli/issues/34446 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | abrahamsaanchez |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width