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
1 changed files with 2 additions and 1 deletions

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){