|
|
@@ -37,6 +37,7 @@ this.singlefile.lib.modules.fontsAltMinifier = this.singlefile.lib.modules.fonts
|
|
|
const REGEXP_FONT_FORMAT_VALUE = /format\((.*?)\)\s*,?$/;
|
|
|
const REGEXP_FONT_SRC = /(.*?)\s*,?$/;
|
|
|
const EMPTY_URL_SOURCE = /^url\(["']?data:[^,]*,?["']?\)/;
|
|
|
+ const TEXT_CONTENT_URL_SOURCE = /^url\(["']?data:text\//;
|
|
|
const LOCAL_SOURCE = "local(";
|
|
|
const MEDIA_ALL = "all";
|
|
|
const FONT_WEIGHTS = {
|
|
|
@@ -196,7 +197,7 @@ this.singlefile.lib.modules.fontsAltMinifier = this.singlefile.lib.modules.fonts
|
|
|
|
|
|
function processFontFaceRule(ruleData, fontInfo, stats) {
|
|
|
const cssTree = singlefile.lib.vendor.cssTree;
|
|
|
- const findSource = fontFormat => fontInfo.find(source => !source.src.match(EMPTY_URL_SOURCE) && source.format == fontFormat);
|
|
|
+ const findSource = fontFormat => fontInfo.find(source => !source.src.match(EMPTY_URL_SOURCE) && !source.src.match(TEXT_CONTENT_URL_SOURCE) && source.format == fontFormat);
|
|
|
const filterSource = fontSource => fontInfo.filter(source => source == fontSource || source.src.startsWith(LOCAL_SOURCE));
|
|
|
stats.fonts.processed += fontInfo.length;
|
|
|
stats.fonts.discarded += fontInfo.length;
|