File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
packages/@tailwindcss-cli/src/commands/build Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424- Canonicalization: combine ` text-* ` and ` leading-* ` classes ([ #19396 ] ( https://github.com/tailwindlabs/tailwindcss/pull/19396 ) )
2525- Correctly handle duplicate CLI arguments ([ #19416 ] ( https://github.com/tailwindlabs/tailwindcss/pull/19416 ) )
2626- Don’t emit color-mix fallback rules inside ` @keyframes ` ([ #19419 ] ( https://github.com/tailwindlabs/tailwindcss/pull/19419 ) )
27+ - CLI: Don't hang when output is ` /dev/stdout ` ([ #19421 ] ( https://github.com/tailwindlabs/tailwindcss/pull/19421 ) )
2728
2829### Added
2930
Original file line number Diff line number Diff line change @@ -13,10 +13,19 @@ export function drainStdin() {
1313}
1414
1515export async function outputFile ( file : string , contents : string ) {
16- try {
17- let currentContents = await fs . readFile ( file , 'utf8' )
18- if ( currentContents === contents ) return // Skip writing the file
19- } catch { }
16+ // Check for special files like `/dev/stdout` or pipes. We don't want to read from these as that
17+ // will hang the process until the file descriptors are closed.
18+ let isSpecialFile = await fs
19+ . stat ( file )
20+ . then ( ( stats ) => stats . isCharacterDevice ( ) || stats . isFIFO ( ) )
21+ . catch ( ( ) => false )
22+
23+ if ( ! isSpecialFile ) {
24+ try {
25+ let currentContents = await fs . readFile ( file , 'utf8' )
26+ if ( currentContents === contents ) return // Skip writing the file
27+ } catch { }
28+ }
2029
2130 // Ensure the parent directories exist
2231 await fs . mkdir ( path . dirname ( file ) , { recursive : true } )
You can’t perform that action at this time.
0 commit comments