瀏覽代碼

rollback (prefer woff2 over woff)

Gildas 7 年之前
父節點
當前提交
5169d4f6da
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      lib/single-file/css-fonts-minifier.js

+ 3 - 3
lib/single-file/css-fonts-minifier.js

@@ -226,12 +226,12 @@ this.fontsMinifier = this.fontsMinifier || (() => {
 		});
 		const fontTest = (fontSource, format) => fontSource.src != EMPTY_URL_SOURCE && fontSource.format == format;
 		let woffFontFound = fontSources.find(fontSource => fontTest(fontSource, "woff2-variations"));
-		if (!woffFontFound) {
-			woffFontFound = fontSources.find(fontSource => fontTest(fontSource, "woff"));
-		}
 		if (!woffFontFound) {
 			woffFontFound = fontSources.find(fontSource => fontTest(fontSource, "woff2"));
 		}
+		if (!woffFontFound) {
+			woffFontFound = fontSources.find(fontSource => fontTest(fontSource, "woff"));
+		}		
 		stats.fonts.processed += fontSources.length;
 		stats.fonts.discarded += fontSources.length;
 		if (woffFontFound) {