@unocss/preset-icons 0.27.3 → 0.27.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 CHANGED
@@ -8,6 +8,7 @@ const customisations = require('@iconify/utils/lib/customisations');
8
8
  const getIcon = require('@iconify/utils/lib/icon-set/get-icon');
9
9
 
10
10
  const isNode = typeof process < "u" && typeof process.stdout < "u";
11
+ const isVSCode = isNode && !!process.env.VSCODE_CWD;
11
12
  function encodeSvg(svg) {
12
13
  return svg.replace("<svg", ~svg.indexOf("xmlns") ? "<svg" : '<svg xmlns="http://www.w3.org/2000/svg"').replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/{/g, "%7B").replace(/}/g, "%7D").replace(/</g, "%3C").replace(/>/g, "%3E");
13
14
  }
@@ -30,7 +31,7 @@ async function searchForIcon(collection, id, collections, scale) {
30
31
  let iconSet = collections[collection];
31
32
  if (typeof iconSet === "function")
32
33
  iconSet = await iconSet();
33
- if (!iconSet && isNode) {
34
+ if (!iconSet && isNode && !isVSCode) {
34
35
  try {
35
36
  const loadCollectionFromFS = await importFsModule().then((i) => i?.loadCollectionFromFS);
36
37
  if (loadCollectionFromFS)
package/dist/index.mjs CHANGED
@@ -4,6 +4,7 @@ import { defaults } from '@iconify/utils/lib/customisations';
4
4
  import { getIconData } from '@iconify/utils/lib/icon-set/get-icon';
5
5
 
6
6
  const isNode = typeof process < "u" && typeof process.stdout < "u";
7
+ const isVSCode = isNode && !!process.env.VSCODE_CWD;
7
8
  function encodeSvg(svg) {
8
9
  return svg.replace("<svg", ~svg.indexOf("xmlns") ? "<svg" : '<svg xmlns="http://www.w3.org/2000/svg"').replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/{/g, "%7B").replace(/}/g, "%7D").replace(/</g, "%3C").replace(/>/g, "%3E");
9
10
  }
@@ -26,7 +27,7 @@ async function searchForIcon(collection, id, collections, scale) {
26
27
  let iconSet = collections[collection];
27
28
  if (typeof iconSet === "function")
28
29
  iconSet = await iconSet();
29
- if (!iconSet && isNode) {
30
+ if (!iconSet && isNode && !isVSCode) {
30
31
  try {
31
32
  const loadCollectionFromFS = await importFsModule().then((i) => i?.loadCollectionFromFS);
32
33
  if (loadCollectionFromFS)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-icons",
3
- "version": "0.27.3",
3
+ "version": "0.27.4",
4
4
  "description": "Pure CSS Icons for UnoCSS",
5
5
  "keywords": [
6
6
  "unocss",
@@ -43,7 +43,7 @@
43
43
  "types": "dist/index.d.ts",
44
44
  "dependencies": {
45
45
  "@iconify/utils": "^1.0.23",
46
- "@unocss/core": "0.27.3",
46
+ "@unocss/core": "0.27.4",
47
47
  "local-pkg": "^0.4.1"
48
48
  },
49
49
  "devDependencies": {