|
|
@@ -987,7 +987,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
|
|
|
const dataURI = await batchRequest.addURL(resourceURL);
|
|
|
if (!inline && options.compressCSS && dataURI.startsWith(PREFIX_DATA_URI_IMAGE) && !dataURI.startsWith(PREFIX_DATA_URI_IMAGE_SVG)) {
|
|
|
const functions = stylesheetContent.match(DomUtil.getRegExp(urlFunction));
|
|
|
- if (functions.length > 1) {
|
|
|
+ if (functions && functions.length > 1) {
|
|
|
const variableName = "--single-file-" + indexStyle + "-" + indexVariable;
|
|
|
stylesheetContent = variableName + ":url(\"" + dataURI + "\")" + (indexVariable ? ";" : "}") + stylesheetContent;
|
|
|
stylesheetContent = stylesheetContent.replace(DomUtil.getRegExp(urlFunction), "var(" + variableName + ")");
|