Skip to content

Commit

Permalink
Ensure build command is executed when using --output instead of `…
Browse files Browse the repository at this point in the history
…-o` (#13369)
  • Loading branch information
RobinMalfait authored Mar 27, 2024
1 parent 99c4afd commit c815221
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Remove percentage values for `translate-z` utilities ([#13321](https://github.com/tailwindlabs/tailwindcss/pull/13321), [#13327](https://github.com/tailwindlabs/tailwindcss/pull/13327))
- `@tailwind/vite` now generates unique CSS bundle hashes when the Tailwind-generated CSS changes ([#13218](https://github.com/tailwindlabs/tailwindcss/pull/13218))
- Inherit letter spacing in form controls ([#13328](https://github.com/tailwindlabs/tailwindcss/pull/13328))
- Ensure `build` command is executed when using `--output` instead of `-o` ([#13369](https://github.com/tailwindlabs/tailwindcss/pull/13369))

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

Expand Down
11 changes: 7 additions & 4 deletions packages/@tailwindcss-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ const sharedOptions = {
'--help': { type: 'boolean', description: 'Display usage information', alias: '-h' },
} satisfies Arg

const shared = args(sharedOptions)
const command = shared._[0]
const flags = args({
...build.options(),
...sharedOptions,
})
const command = flags._[0]

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

// Handle the build command
build.handle(args(build.options()))
build.handle(flags)

0 comments on commit c815221

Please sign in to comment.