|
@@ -206,7 +206,7 @@ this.singlefile.lib.modules.fontsAltMinifier = this.singlefile.lib.modules.fonts
|
|
|
removedNodes.pop();
|
|
removedNodes.pop();
|
|
|
removedNodes.forEach(node => ruleData.block.children.remove(node));
|
|
removedNodes.forEach(node => ruleData.block.children.remove(node));
|
|
|
const srcDeclaration = ruleData.block.children.filter(node => node.property == "src").tail;
|
|
const srcDeclaration = ruleData.block.children.filter(node => node.property == "src").tail;
|
|
|
- await Promise.all(fontInfo.map(async source => {
|
|
|
|
|
|
|
+ await Promise.all(fontInfo.map(async (source, sourceIndex) => {
|
|
|
if (FontFace) {
|
|
if (FontFace) {
|
|
|
const fontFace = new FontFace("test-font", source.src);
|
|
const fontFace = new FontFace("test-font", source.src);
|
|
|
try {
|
|
try {
|
|
@@ -214,7 +214,8 @@ this.singlefile.lib.modules.fontsAltMinifier = this.singlefile.lib.modules.fonts
|
|
|
await fontFace.loaded;
|
|
await fontFace.loaded;
|
|
|
source.valid = true;
|
|
source.valid = true;
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- const fontURL = fontURLs.get(srcDeclaration.data);
|
|
|
|
|
|
|
+ const declarationFontURLs = fontURLs.get(srcDeclaration.data);
|
|
|
|
|
+ const fontURL = declarationFontURLs[declarationFontURLs.length - sourceIndex - 1];
|
|
|
const fontFace = new FontFace("test-font", "url(" + fontURL + ")");
|
|
const fontFace = new FontFace("test-font", "url(" + fontURL + ")");
|
|
|
try {
|
|
try {
|
|
|
await Promise.race(
|
|
await Promise.race(
|