tailwindcss/integrations
Robin Malfait 6de87c62c4
Fix changes to symlinked files outside of the project works (#20356)
This PR fixes an issue where changes to a symlinked file wouldn't result
in hot-reload when using `@tailwincdss/vite`. This issue also exists in
the other packages such as `@tailwincdss/postcss`,
`@tailwincdss/webpack` and `@tailwincdss/cli`.

The issue is that we watch the symlinked file, but not the "real" file
for changes. If the source of the symlinked file lives in another folder
that is not covered by auto-source detection or by any of the `@source`
directives, then changes to that file won't trigger a change.

To solve this, if a file is symlinked or lives in a symlinked folder,
then we will make sure that the `scanner.files` contains the real path /
canonicalized path to the real file as well just so we can detect
changes in that file.

Fixes: #20346
Closes: #20347

## Test plan

1. Added a regression test for `@tailwindcss/vite` 
2. Added tests in the scanner code itself
3. Manually tested on the reproduction:

|   | Initial state | After change |
| ---: | --- | --- |
| **Before** | <img width="3200" height="1800"
alt="file-f8616573eec3150ae484fd279204c6d7"
src="https://github.com/user-attachments/assets/2734ecc3-b5b6-420e-820d-8a4a8fcdd7f5"
/> | <img width="3200" height="1800"
alt="file-0e93fd3c2c9694c844b098616a3208d2"
src="https://github.com/user-attachments/assets/fd86859b-420b-476b-80f6-e94d02e8b07b"
/> |
| **After** | <img width="3200" height="1800"
alt="file-f8616573eec3150ae484fd279204c6d7"
src="https://github.com/user-attachments/assets/2734ecc3-b5b6-420e-820d-8a4a8fcdd7f5"
/> | <img width="3200" height="1800"
alt="file-eb7b37430ea1363dddeac7226007afe4"
src="https://github.com/user-attachments/assets/0a95b1a4-a357-491d-b57f-78460c0fc9db"
/> |


[ci-all]

---------

Co-authored-by: Nic <162764842+Nic-Polumeyv@users.noreply.github.com>
2026-07-28 12:40:02 +02:00
..
cli Fix weird character rendering on Windows with Japanese locale (#20318) 2026-07-14 17:04:20 +02:00
oxide chore: fix some typos in comments (#19475) 2025-12-22 13:09:19 +00:00
postcss Improve codebase quality (#19999) 2026-04-30 23:32:37 +02:00
upgrade Fix failing upgrade test in CI (#20357) 2026-07-28 00:21:06 +02:00
vite Fix changes to symlinked files outside of the project works (#20356) 2026-07-28 12:40:02 +02:00
webpack Fix webpack loader cache key for resource queries (#19723) 2026-03-20 16:34:11 +00:00
package.json migrate to pnpm v11 (#20273) 2026-06-25 19:14:10 +02:00
utils.ts migrate to pnpm v11 (#20273) 2026-06-25 19:14:10 +02:00
vitest.config.ts Improve integration tests (stability + performance) (#15125) 2024-12-12 13:48:56 +01:00