@unocss/preset-icons 0.15.2 → 0.15.6
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 -1
- package/dist/index.mjs +8 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -13,6 +13,13 @@ function encodeSvg(svg) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const COLLECTION_NAME_PARTS_MAX = 3;
|
|
16
|
+
async function importFsModule() {
|
|
17
|
+
try {
|
|
18
|
+
return await import('./fs.cjs');
|
|
19
|
+
} catch {
|
|
20
|
+
return require("./fs.cjs");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
16
23
|
async function searchForIcon(collection, id, collections, scale) {
|
|
17
24
|
if (!collection || !id)
|
|
18
25
|
return;
|
|
@@ -20,7 +27,7 @@ async function searchForIcon(collection, id, collections, scale) {
|
|
|
20
27
|
if (typeof iconSet === "function")
|
|
21
28
|
iconSet = await iconSet();
|
|
22
29
|
if (!iconSet && isNode) {
|
|
23
|
-
const { loadCollectionFromFS } = await
|
|
30
|
+
const { loadCollectionFromFS } = await importFsModule();
|
|
24
31
|
iconSet = await loadCollectionFromFS(collection);
|
|
25
32
|
}
|
|
26
33
|
if (!iconSet)
|
package/dist/index.mjs
CHANGED
|
@@ -9,6 +9,13 @@ function encodeSvg(svg) {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
const COLLECTION_NAME_PARTS_MAX = 3;
|
|
12
|
+
async function importFsModule() {
|
|
13
|
+
try {
|
|
14
|
+
return await import('./fs.mjs');
|
|
15
|
+
} catch {
|
|
16
|
+
return require("./fs.cjs");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
12
19
|
async function searchForIcon(collection, id, collections, scale) {
|
|
13
20
|
if (!collection || !id)
|
|
14
21
|
return;
|
|
@@ -16,7 +23,7 @@ async function searchForIcon(collection, id, collections, scale) {
|
|
|
16
23
|
if (typeof iconSet === "function")
|
|
17
24
|
iconSet = await iconSet();
|
|
18
25
|
if (!iconSet && isNode) {
|
|
19
|
-
const { loadCollectionFromFS } = await
|
|
26
|
+
const { loadCollectionFromFS } = await importFsModule();
|
|
20
27
|
iconSet = await loadCollectionFromFS(collection);
|
|
21
28
|
}
|
|
22
29
|
if (!iconSet)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-icons",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.6",
|
|
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.20",
|
|
46
|
-
"@unocss/core": "0.15.
|
|
46
|
+
"@unocss/core": "0.15.6",
|
|
47
47
|
"local-pkg": "^0.4.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|