@@ -146,6 +146,7 @@ function resolveConfigPath(pathOrConfig) {
146
146
}
147
147
148
148
let configPathCache = new LRU ( { maxSize : 100 } )
149
+ let lastTailwindConfigHash = null
149
150
150
151
// Get the config object based on a path
151
152
function getTailwindConfig ( configOrPath ) {
@@ -174,7 +175,7 @@ function getTailwindConfig(configOrPath) {
174
175
configOrPath . config === undefined ? configOrPath : configOrPath . config
175
176
)
176
177
177
- return [ newConfig , null , hash ( newConfig ) ]
178
+ return [ newConfig , null , newConfig . hash || hash ( newConfig ) ]
178
179
}
179
180
180
181
let fileModifiedMap = new Map ( )
@@ -656,8 +657,10 @@ function setupContext(configOrPath) {
656
657
if ( ! contextDependenciesChanged ) {
657
658
// If this file already has a context in the cache and we don't need to
658
659
// reset the context, return the cached context.
659
- if ( isConfigFile && contextMap . has ( sourcePath ) ) {
660
- return contextMap . get ( sourcePath )
660
+ if ( contextMap . has ( sourcePath ) ) {
661
+ if ( isConfigFile || ( lastTailwindConfigHash && tailwindConfigHash === lastTailwindConfigHash ) ) {
662
+ return contextMap . get ( sourcePath )
663
+ }
661
664
}
662
665
663
666
// If the config used already exists in the cache, return that.
@@ -669,6 +672,8 @@ function setupContext(configOrPath) {
669
672
}
670
673
}
671
674
675
+ lastTailwindConfigHash = tailwindConfigHash
676
+
672
677
// If this source is in the context map, get the old context.
673
678
// Remove this source from the context sources for the old context,
674
679
// and clean up that context if no one else is using it. This can be
0 commit comments