Merge pull request #784 from vector-im/fix-build-race
Fix build error caused due to race in postcss plugin
This commit is contained in:
commit
28b686dae7
2 changed files with 15 additions and 2 deletions
|
@ -112,7 +112,14 @@ function populateMapWithDerivedVariables(map, cssFileLocation, {resolvedMap, ali
|
|||
...([...resolvedMap.keys()].filter(v => !aliasMap.has(v))),
|
||||
...([...aliasMap.entries()].map(([alias, variable]) => `${alias}=${variable}`))
|
||||
];
|
||||
map.set(location, { "derived-variables": derivedVariables });
|
||||
const sharedObject = map.get(location);
|
||||
const output = { "derived-variables": derivedVariables };
|
||||
if (sharedObject) {
|
||||
Object.assign(sharedObject, output);
|
||||
}
|
||||
else {
|
||||
map.set(location, output);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -55,7 +55,13 @@ function addResolvedVariablesToRootSelector(root, { Rule, Declaration }, urlVari
|
|||
function populateMapWithIcons(map, cssFileLocation, urlVariables) {
|
||||
const location = cssFileLocation.match(/(.+)\/.+\.css/)?.[1];
|
||||
const sharedObject = map.get(location);
|
||||
sharedObject["icon"] = Object.fromEntries(urlVariables);
|
||||
const output = {"icon": Object.fromEntries(urlVariables)};
|
||||
if (sharedObject) {
|
||||
Object.assign(sharedObject, output);
|
||||
}
|
||||
else {
|
||||
map.set(location, output);
|
||||
}
|
||||
}
|
||||
|
||||
function *createCounter() {
|
||||
|
|
Reference in a new issue