tailwindcss/packages
Robin Malfait b03e5e7731
Lazy load @parcel/watcher (#20325)
This PR ensure that we lazy load the `@parcel/watcher` in the
`@tailwindcss/cli`. This means that we don't have to load it at all when
using a normal build or when using `--watch --poll` combination.

The bigger reason is that on some platforms `@parcel/watcher` might not
work, and therefore the build will fail even if you don't use `--watch`
at all.

This PR fixes that by lazy loading it. Then, if we can't load it when
using `--watch`, a useful workaround is shown by using `--watch --poll`
instead.

This PR also improves showing errors such that the `error.cause`
property can be rendered as well.

Maybe in the future we can make use of deferred imports
(https://github.com/tc39/proposal-defer-import-eval)

Fixes: #20322

## Test plan

1. All tests still pass [ci-all]
2. Fabricated a fake error locally to prove that we can still use a
normal build and `--watch --poll` as a workaround

<img width="1122" height="1376"
alt="file-2f91d99cfb9eb0e24a196c2dd358c1f3"
src="https://github.com/user-attachments/assets/e37658ee-0827-422e-bd50-8ea5a85e1b7c"
/>
2026-07-13 15:53:42 +02:00
..
@tailwindcss-browser 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-cli Lazy load @parcel/watcher (#20325) 2026-07-13 15:53:42 +02:00
@tailwindcss-node 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-postcss Ensure @tailwindcss/postcss rebuilds when the input CSS changes but its mtime is unchanged (#20310) 2026-07-06 11:32:20 +00:00
@tailwindcss-standalone Bump dependencies (#20300) 2026-07-02 11:45:49 +02:00
@tailwindcss-upgrade 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-vite 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
@tailwindcss-webpack 4.3.2 (#20281) 2026-06-29 10:10:00 -04:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
tailwindcss Always produce <length> value when optimizing --spacing(0) (#20319) 2026-07-09 18:34:27 +02:00
tsconfig.base.json Improve debug logs (#15303) 2024-12-11 15:27:20 +01:00