[Bug]: Tailwind with --watch not working in dev build
bugtriage
### To Reproduce
I have a basically-new app copied from the boilerplate just yesterday. From there:
1. Run `pnpm dev`
2. Edit `pages/content-ui/src/matches/all/App.tsx` to add a tailwind class which hasn't been used elsewhere in the app yet. In my case, `opacity-1`
3. The `opacity-1` styles aren't applied in the app; `opacity-1` doesn't appear in `pages/content-ui/dist/all/index.css` as it should after the tailwind build
4. Restart `pnpm dev`
5. `opacity-1` now appears in `pages/content-ui/dist/all/index.css`
### Expected Behavior
`opacity-1` should appear in step (3) after `pnpm dev` automatically rebuilds the app.
### Screenshots
_No response_
### OS
macOS
### Browser
Chrome
### Node Version
22.19.0
### Other Necessary Packages Version
pnpm v10.11.0
### Additional Context
I added logging to `pages/content-ui/build.mts` and verified `IS_DEV` is set to true. So it should be running `buildTW` with `--watch`, but that's as far as I know how to debug. It's strange to me that we `await buildTW(args)` when I'd expect `--watch` to keep the command running, but I'm not familiar with how Vite handles that.
Including my new logs (the ones with timestamps), my log output for for `@extension/content-ui#dev` is this:
```
> @extension/content-ui@0.5.0 dev /Users/alex/projects/moodcatcher/pages/content-ui
> tsx build.mts
[dotenvx@1.49.0] injecting env (2) from /Users/alex/projects/moodcatcher/packages/env/dist/lib/../../../../.env
[2025-09-19T18:09:05.739Z] Building all...
[2025-09-19T18:09:05.740Z] IS_DEV: true
[2025-09-19T18:09:05.740Z] Config: /Users/alex/projects/moodcatcher/pages/content-ui/tailwind.config.ts
[2025-09-19T18:09:05.872Z] Building example...
[2025-09-19T18:09:05.872Z] IS_DEV: true
[2025-09-19T18:09:05.872Z] Config: /Users/alex/projects/moodcatcher/pages/content-ui/tailwind.config.ts
Rebuilding...
Rebuilding...
Done in 462ms.
[2025-09-19T18:09:06.336Z] all Tailwind build completed in 597ms
vite v6.3.6 building for development...
watching for file changes...
Done in 498ms.
[2025-09-19T18:09:06.372Z] example Tailwind build completed in 500ms
vite v6.3.6 building for development...
watching for file changes...
[2025-09-19T18:09:06.530Z] all total build completed in 791ms
[2025-09-19T18:09:06.530Z] example total build completed in 658ms
build started...
build started... (x2)
✓ 104 modules transformed.
✓ 104 modules transformed. (x2)
../../dist/content-ui/all.iife.js 0.03 kB │ map: 2,504.72 kB
built in 3158ms.
[HMR] Connected to dev-server at ws://localhost:8081
../../dist/content-ui/example.iife.js 0.03 kB │ map: 2,519.32 kB
built in 3376ms.
[HMR] Connected to dev-server at ws://localhost:8081
```
2 条评论