@unocss/preset-icons 0.24.4 → 0.26.1
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 +8 -3
- package/dist/index.mjs +8 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -17,7 +17,11 @@ async function importFsModule() {
|
|
|
17
17
|
try {
|
|
18
18
|
return await import('./fs.cjs');
|
|
19
19
|
} catch {
|
|
20
|
-
|
|
20
|
+
try {
|
|
21
|
+
return require("./fs.cjs");
|
|
22
|
+
} catch {
|
|
23
|
+
return void 0;
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
27
|
async function searchForIcon(collection, id, collections, scale) {
|
|
@@ -27,8 +31,9 @@ async function searchForIcon(collection, id, collections, scale) {
|
|
|
27
31
|
if (typeof iconSet === "function")
|
|
28
32
|
iconSet = await iconSet();
|
|
29
33
|
if (!iconSet && isNode) {
|
|
30
|
-
const
|
|
31
|
-
|
|
34
|
+
const loadCollectionFromFS = await importFsModule().then((i) => i?.loadCollectionFromFS);
|
|
35
|
+
if (loadCollectionFromFS)
|
|
36
|
+
iconSet = await loadCollectionFromFS(collection);
|
|
32
37
|
}
|
|
33
38
|
if (!iconSet)
|
|
34
39
|
return;
|
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,11 @@ async function importFsModule() {
|
|
|
13
13
|
try {
|
|
14
14
|
return await import('./fs.mjs');
|
|
15
15
|
} catch {
|
|
16
|
-
|
|
16
|
+
try {
|
|
17
|
+
return require("./fs.cjs");
|
|
18
|
+
} catch {
|
|
19
|
+
return void 0;
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
23
|
async function searchForIcon(collection, id, collections, scale) {
|
|
@@ -23,8 +27,9 @@ async function searchForIcon(collection, id, collections, scale) {
|
|
|
23
27
|
if (typeof iconSet === "function")
|
|
24
28
|
iconSet = await iconSet();
|
|
25
29
|
if (!iconSet && isNode) {
|
|
26
|
-
const
|
|
27
|
-
|
|
30
|
+
const loadCollectionFromFS = await importFsModule().then((i) => i?.loadCollectionFromFS);
|
|
31
|
+
if (loadCollectionFromFS)
|
|
32
|
+
iconSet = await loadCollectionFromFS(collection);
|
|
28
33
|
}
|
|
29
34
|
if (!iconSet)
|
|
30
35
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-icons",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"description": "Pure CSS Icons for UnoCSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"unocss",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@iconify/utils": "^1.0.23",
|
|
46
|
-
"@unocss/core": "0.
|
|
46
|
+
"@unocss/core": "0.26.1",
|
|
47
47
|
"local-pkg": "^0.4.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|