Skip to content

Commit c815221

Browse files
authored
Ensure build command is executed when using --output instead of -o (#13369)
1 parent 99c4afd commit c815221

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919
- Remove percentage values for `translate-z` utilities ([#13321](https://github.com/tailwindlabs/tailwindcss/pull/13321), [#13327](https://github.com/tailwindlabs/tailwindcss/pull/13327))
2020
- `@tailwind/vite` now generates unique CSS bundle hashes when the Tailwind-generated CSS changes ([#13218](https://github.com/tailwindlabs/tailwindcss/pull/13218))
2121
- Inherit letter spacing in form controls ([#13328](https://github.com/tailwindlabs/tailwindcss/pull/13328))
22+
- Ensure `build` command is executed when using `--output` instead of `-o` ([#13369](https://github.com/tailwindlabs/tailwindcss/pull/13369))
2223

2324
## [4.0.0-alpha.10] - 2024-03-19
2425

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ const sharedOptions = {
99
'--help': { type: 'boolean', description: 'Display usage information', alias: '-h' },
1010
} satisfies Arg
1111

12-
const shared = args(sharedOptions)
13-
const command = shared._[0]
12+
const flags = args({
13+
...build.options(),
14+
...sharedOptions,
15+
})
16+
const command = flags._[0]
1417

1518
// Right now we don't support any sub-commands. Let's show the help message
1619
// instead.
@@ -33,7 +36,7 @@ if (command) {
3336
//
3437
// - `tailwindcss -o output.css` // should run the build command, not show the help message
3538
// - `tailwindcss > output.css` // should run the build command, not show the help message
36-
if ((process.stdout.isTTY && !process.argv.slice(2).includes('-o')) || shared['--help']) {
39+
if ((process.stdout.isTTY && !flags['--output']) || flags['--help']) {
3740
help({
3841
usage: ['tailwindcss [--input input.css] [--output output.css] [--watch] [options…]'],
3942
options: { ...build.options(), ...sharedOptions },
@@ -42,4 +45,4 @@ if ((process.stdout.isTTY && !process.argv.slice(2).includes('-o')) || shared['-
4245
}
4346

4447
// Handle the build command
45-
build.handle(args(build.options()))
48+
build.handle(flags)

0 commit comments

Comments
 (0)