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
7
7
8
8
## [ Unreleased]
9
9
10
- - Nothing yet!
10
+ ### Fixed
11
+
12
+ - Enable Vite's ` waitForRequestsIdle() ` for client requests only ([ #13394 ] ( https://github.com/tailwindlabs/tailwindcss/pull/13394 ) )
11
13
12
14
## [ 4.0.0-alpha.11] - 2024-03-27
13
15
Original file line number Diff line number Diff line change @@ -159,19 +159,18 @@ export default function tailwindcss(): Plugin[] {
159
159
name : '@tailwindcss/vite:generate:serve' ,
160
160
apply : 'serve' ,
161
161
162
- async transform ( src , id ) {
162
+ async transform ( src , id , options ) {
163
163
if ( ! isTailwindCssFile ( id , src ) ) return
164
164
165
165
// In serve mode, we treat cssModules as a set, ignoring the value.
166
166
cssModules [ id ] = ''
167
167
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
+ }
175
174
176
175
let code = await transformWithPlugins ( this , id , generateCss ( src ) )
177
176
return { code }
You can’t perform that action at this time.
0 commit comments