|
|
@@ -33,7 +33,7 @@ this.fontsAltMinifier = this.fontsAltMinifier || (() => {
|
|
|
const REGEXP_FONT_FORMAT = /\.([^.?#]+)((\?|#).*?)?$/;
|
|
|
const REGEXP_FONT_FORMAT_VALUE = /format\((.*?)\)\s*,?$/;
|
|
|
const REGEXP_FONT_SRC = /(.*?)\s*,?$/;
|
|
|
- const EMPTY_URL_SOURCE = "url(\"data:base64,\")";
|
|
|
+ const EMPTY_URL_SOURCE = /^url\(["']?data:base64,["']?\)/;
|
|
|
const LOCAL_SOURCE = "local(";
|
|
|
const MEDIA_ALL = "all";
|
|
|
const FONT_WEIGHTS = {
|
|
|
@@ -187,7 +187,7 @@ this.fontsAltMinifier = this.fontsAltMinifier || (() => {
|
|
|
}
|
|
|
|
|
|
function processFontFaceRule(cssRule, fontInfo, stats) {
|
|
|
- const findSource = fontFormat => fontInfo.find(source => source.src != EMPTY_URL_SOURCE && source.format == fontFormat);
|
|
|
+ const findSource = fontFormat => fontInfo.find(source => !source.src.match(EMPTY_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;
|