|
|
@@ -98,7 +98,12 @@ this.fontsMinifier = this.fontsMinifier || (() => {
|
|
|
if (variableFound) {
|
|
|
unusedFonts = [];
|
|
|
} else {
|
|
|
- const filteredUsedFonts = new Set(usedFonts.map(fontNames => fontNames.find(fontName => declaredFonts.has(fontName))).filter(fontName => fontName));
|
|
|
+ const filteredUsedFonts = new Set();
|
|
|
+ usedFonts.forEach(fontNames => fontNames.forEach(fontName => {
|
|
|
+ if (declaredFonts.has(fontName)) {
|
|
|
+ filteredUsedFonts.add(fontName);
|
|
|
+ }
|
|
|
+ }));
|
|
|
unusedFonts = Array.from(declaredFonts).filter(fontFamilyName => !filteredUsedFonts.has(fontFamilyName));
|
|
|
}
|
|
|
doc.querySelectorAll("style").forEach(style => {
|