diff --git a/CHANGELOG.md b/CHANGELOG.md index 015e877b8e3b..6ec1c71fe80d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/packages/@tailwindcss-cli/src/index.ts b/packages/@tailwindcss-cli/src/index.ts index 3622a858c438..511781759079 100644 --- a/packages/@tailwindcss-cli/src/index.ts +++ b/packages/@tailwindcss-cli/src/index.ts @@ -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. @@ -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 }, @@ -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)