cleanup old contexts in config hash map (#4571)

This commit is contained in:
Brad Cornes 2021-06-07 18:49:38 +01:00 • committed by GitHub
parent 67ee5e033d
commit f1e31682c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -558,6 +558,11 @@ export function getContext(
contextSourcesMap.get(oldContext).delete(sourcePath)
if (contextSourcesMap.get(oldContext).size === 0) {
contextSourcesMap.delete(oldContext)
for (let [tailwindConfigHash, context] of configContextMap) {
if (context === oldContext) {
configContextMap.delete(tailwindConfigHash)
}
}
for (let disposable of oldContext.disposables.splice(0)) {
disposable(oldContext)
}