Do not add variables to root for runtime theme

This commit is contained in:
RMidhunSuresh 2022-07-04 16:41:06 +05:30
parent 8c02541b69
commit bf87ed7eae

View file

@ -81,7 +81,8 @@ module.exports = (opts = {}) => {
const urlVariables = new Map();
const counter = createCounter();
root.walkDecls(decl => findAndReplaceUrl(decl, urlVariables, counter));
if (urlVariables.size) {
const cssFileLocation = root.source.input.from;
if (urlVariables.size && !cssFileLocation.includes("type=runtime")) {
addResolvedVariablesToRootSelector(root, { Rule, Declaration }, urlVariables);
}
if (opts.compiledVariables){