@unocss/preset-web-fonts 0.45.3 → 0.45.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -6
- package/dist/index.mjs +4 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -68,17 +68,15 @@ const preset = (options = {}) => {
|
|
|
68
68
|
async function importUrl(url) {
|
|
69
69
|
if (inlineImports) {
|
|
70
70
|
if (!importCache[url]) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
importCache[url] = await $fetch(url, { headers: {} });
|
|
74
|
-
} catch (e) {
|
|
71
|
+
const { $fetch } = await import('ohmyfetch');
|
|
72
|
+
importCache[url] = $fetch(url, { headers: {}, retry: 3 }).catch((e) => {
|
|
75
73
|
console.error("Failed to fetch web fonts");
|
|
76
74
|
console.error(e);
|
|
77
75
|
if (typeof process !== "undefined" && process.env.CI)
|
|
78
76
|
throw e;
|
|
79
|
-
}
|
|
77
|
+
});
|
|
80
78
|
}
|
|
81
|
-
return importCache[url];
|
|
79
|
+
return await importCache[url];
|
|
82
80
|
} else {
|
|
83
81
|
return `@import url('${url}')`;
|
|
84
82
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -64,17 +64,15 @@ const preset = (options = {}) => {
|
|
|
64
64
|
async function importUrl(url) {
|
|
65
65
|
if (inlineImports) {
|
|
66
66
|
if (!importCache[url]) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
importCache[url] = await $fetch(url, { headers: {} });
|
|
70
|
-
} catch (e) {
|
|
67
|
+
const { $fetch } = await import('ohmyfetch');
|
|
68
|
+
importCache[url] = $fetch(url, { headers: {}, retry: 3 }).catch((e) => {
|
|
71
69
|
console.error("Failed to fetch web fonts");
|
|
72
70
|
console.error(e);
|
|
73
71
|
if (typeof process !== "undefined" && process.env.CI)
|
|
74
72
|
throw e;
|
|
75
|
-
}
|
|
73
|
+
});
|
|
76
74
|
}
|
|
77
|
-
return importCache[url];
|
|
75
|
+
return await importCache[url];
|
|
78
76
|
} else {
|
|
79
77
|
return `@import url('${url}')`;
|
|
80
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-web-fonts",
|
|
3
|
-
"version": "0.45.
|
|
3
|
+
"version": "0.45.4",
|
|
4
4
|
"description": "Web Fonts support for Uno CSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"*.css"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@unocss/core": "0.45.
|
|
45
|
+
"@unocss/core": "0.45.4",
|
|
46
46
|
"ohmyfetch": "^0.4.18"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|