Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (relativeFile[0] !== '.') {
relativeFile = `./${relativeFile}`;
}
return `url(${left}${relativeFile}${right})`;
} else {
return total;
}
} else {
return total;
}
});
// find comments should after content.replace(...), otherwise the comments offset will be incorrect
const commentRanges = utils.findComments(content);
// replace @import "..."
function * importReplacer(total) {
// if current import is in comments, then skip it
const range = this;
const finded = commentRanges.find((commentRange) => {
if (range.start >= commentRange[0] && range.end <= commentRange[1]) {
return true;
}
});
if (finded) {
return total;
}
const contents = [];