File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
packages/@tailwindcss-vite/src Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10- - Nothing yet!
10+ ### Fixed
11+
12+ - Enable Vite's ` waitForRequestsIdle() ` for client requests only ([ #13394 ] ( https://github.com/tailwindlabs/tailwindcss/pull/13394 ) )
1113
1214## [ 4.0.0-alpha.11] - 2024-03-27
1315
Original file line number Diff line number Diff line change @@ -159,19 +159,18 @@ export default function tailwindcss(): Plugin[] {
159159 name : '@tailwindcss/vite:generate:serve' ,
160160 apply : 'serve' ,
161161
162- async transform ( src , id ) {
162+ async transform ( src , id , options ) {
163163 if ( ! isTailwindCssFile ( id , src ) ) return
164164
165165 // In serve mode, we treat cssModules as a set, ignoring the value.
166166 cssModules [ id ] = ''
167167
168- // TODO: Re-enable waitForRequestsIdle once issues with it hanging are
169- // fixed. Until then, this transformation may run multiple times in
170- // serve mode, possibly giving a FOUC.
171- //
172- // Wait until all other files have been processed, so we can extract all
173- // candidates before generating CSS.
174- // await server?.waitForRequestsIdle?.(id)
168+ if ( ! options ?. ssr ) {
169+ // Wait until all other files have been processed, so we can extract
170+ // all candidates before generating CSS. This must not be called
171+ // during SSR or it will block the server.
172+ await server ?. waitForRequestsIdle ?.( id )
173+ }
175174
176175 let code = await transformWithPlugins ( this , id , generateCss ( src ) )
177176 return { code }
You can’t perform that action at this time.
0 commit comments