@unocss/preset-web-fonts 0.49.1 → 0.49.2
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 +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -92,7 +92,7 @@ const preset = (options = {}) => {
|
|
|
92
92
|
if (inlineImports) {
|
|
93
93
|
if (!importCache[url]) {
|
|
94
94
|
const userAgentWoff2 = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36";
|
|
95
|
-
const promise = customFetch ? customFetch(url) : (await import('
|
|
95
|
+
const promise = customFetch ? customFetch(url) : (await import('ofetch')).$fetch(url, { headers: { "User-Agent": userAgentWoff2 }, retry: 3 });
|
|
96
96
|
importCache[url] = promise.catch((e) => {
|
|
97
97
|
console.error("Failed to fetch web fonts");
|
|
98
98
|
console.error(e);
|
package/dist/index.mjs
CHANGED
|
@@ -88,7 +88,7 @@ const preset = (options = {}) => {
|
|
|
88
88
|
if (inlineImports) {
|
|
89
89
|
if (!importCache[url]) {
|
|
90
90
|
const userAgentWoff2 = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36";
|
|
91
|
-
const promise = customFetch ? customFetch(url) : (await import('
|
|
91
|
+
const promise = customFetch ? customFetch(url) : (await import('ofetch')).$fetch(url, { headers: { "User-Agent": userAgentWoff2 }, retry: 3 });
|
|
92
92
|
importCache[url] = promise.catch((e) => {
|
|
93
93
|
console.error("Failed to fetch web fonts");
|
|
94
94
|
console.error(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-web-fonts",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.2",
|
|
4
4
|
"description": "Web Fonts support for Uno CSS",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"*.css"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@unocss/core": "0.49.
|
|
41
|
-
"
|
|
40
|
+
"@unocss/core": "0.49.2",
|
|
41
|
+
"ofetch": "^0.4.21"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "unbuild",
|