Skip to content

Commit c5a997c

Browse files
Document --watch=always in the CLI (#18337)
Closes tailwindlabs/tailwindcss.com#1835 We had this in v3 as an undocumented option. We still have it in v4 but it's not documented under the CLI usage but should be. This PR adds this. **before** <img width="803" alt="Screenshot 2025-06-18 at 09 41 40" src="https://github.com/user-attachments/assets/c3becf11-e31d-4355-9d23-bddd0b2fc4a6" /> **after** <img width="1152" alt="Screenshot 2025-06-18 at 09 41 20" src="https://github.com/user-attachments/assets/4f61a156-680d-4f39-b92d-7f0f63270689" />
1 parent 75cbfc2 commit c5a997c

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
- Add heuristic to skip candidate migrations inside `emit(…)` ([#18330](https://github.com/tailwindlabs/tailwindcss/pull/18330))
1111
- Extract candidates with variants in Clojure/ClojureScript keywords ([#18338](https://github.com/tailwindlabs/tailwindcss/pull/18338))
12+
- Document `--watch=always` in the CLI's usage ([#18337](https://github.com/tailwindlabs/tailwindcss/pull/18337))
1213

1314
## [4.1.10] - 2025-06-11
1415

packages/@tailwindcss-cli/src/commands/build/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ export function options() {
4242
},
4343
'--watch': {
4444
type: 'boolean | string',
45-
description: 'Watch for changes and rebuild as needed',
45+
description:
46+
'Watch for changes and rebuild as needed, and use `always` to keep watching when stdin is closed',
4647
alias: '-w',
48+
values: ['always'],
4749
},
4850
'--minify': {
4951
type: 'boolean',

packages/@tailwindcss-cli/src/commands/help/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ export function help({
112112
// `alias` followed by `, ` and followed by the `flag`.
113113
let maxOptionLength = 0
114114

115-
for (let [flag, { alias }] of Object.entries(options)) {
115+
for (let [flag, { alias, values }] of Object.entries(options)) {
116+
if (values?.length) {
117+
flag += `[=${values.join(', ')}]`
118+
}
119+
116120
// The option string, which is the combination of the alias and the flag
117121
// but already properly indented based on the other aliases to ensure
118122
// everything is aligned properly.

packages/@tailwindcss-cli/src/utils/args.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type Arg = {
77
description: string
88
alias?: `-${string}`
99
default?: Types[keyof Types]
10+
values?: string[]
1011
}
1112
}
1213

0 commit comments

Comments
 (0)