Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Commit f41b610

Browse files
committed
Prevent context reuse when config changes + multiple files are built
1 parent f02ff4b commit f41b610

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/lib/setupContext.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,12 @@ function setupContext(configOrPath) {
724724

725725
let contextDependenciesChanged = trackModified([...contextDependencies])
726726

727+
let oldConfigHash = sharedState.sourceConfigHashMap.get(sourcePath)
728+
if (tailwindConfigHash !== oldConfigHash) {
729+
contextDependenciesChanged = contextDependenciesChanged || true
730+
sharedState.sourceConfigHashMap.set(sourcePath, tailwindConfigHash)
731+
}
732+
727733
process.env.DEBUG && console.log('Source path:', sourcePath)
728734

729735
if (!contextDependenciesChanged) {

src/lib/sharedState.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ module.exports = {
1111
contextMap: new Map(),
1212
configContextMap: new Map(),
1313
contextSourcesMap: new Map(),
14+
sourceConfigHashMap: new Map(),
1415
contentMatchCache: new LRU({ maxSize: 25000 }),
1516
}

0 commit comments

Comments
 (0)