@@ -308,7 +308,7 @@ function processApplyAtRules(css, lookupTree, config) {
308
308
return css
309
309
}
310
310
311
- let defaultTailwindTree = null
311
+ let defaultTailwindTree = new Map ( )
312
312
313
313
export default function substituteClassApplyAtRules ( config , getProcessedPlugins , configChanged ) {
314
314
return function ( css ) {
@@ -330,14 +330,16 @@ export default function substituteClassApplyAtRules(config, getProcessedPlugins,
330
330
return processApplyAtRules ( css , postcss . root ( ) , config )
331
331
}
332
332
333
+ let lookupKey = requiredTailwindAtRules . join ( ',' )
334
+
333
335
// We mutated the `requiredTailwindAtRules`, but when we hit this point in
334
336
// time, it means that we don't have all the atrules. The missing atrules
335
337
// are listed inside the requiredTailwindAtRules, which we can use to fill
336
338
// in the missing pieces.
337
339
//
338
340
// Important for <style> blocks in Vue components.
339
341
const generateLookupTree =
340
- configChanged || defaultTailwindTree === null
342
+ configChanged || ! defaultTailwindTree . has ( lookupKey )
341
343
? ( ) => {
342
344
return postcss ( [
343
345
substituteTailwindAtRules ( config , getProcessedPlugins ( ) ) ,
@@ -351,11 +353,11 @@ export default function substituteClassApplyAtRules(config, getProcessedPlugins,
351
353
from : undefined ,
352
354
} )
353
355
. then ( ( result ) => {
354
- defaultTailwindTree = result
355
- return defaultTailwindTree
356
+ defaultTailwindTree . set ( lookupKey , result )
357
+ return result
356
358
} )
357
359
}
358
- : ( ) => Promise . resolve ( defaultTailwindTree )
360
+ : ( ) => Promise . resolve ( defaultTailwindTree . get ( lookupKey ) )
359
361
360
362
return generateLookupTree ( ) . then ( ( result ) => {
361
363
return processApplyAtRules ( css , result . root , config )
0 commit comments