@nuxt/icon
Advanced tools
Comparing version 1.4.3 to 1.4.4
@@ -182,2 +182,10 @@ import * as _nuxt_schema from '@nuxt/schema'; | ||
disabled?: boolean; | ||
/** | ||
* External icon JSON files as in the final `node_modules`, instead of bundling them | ||
* This would likely improve the performance of bundling. | ||
* Enabling this option would requires your production Node.js server to be able to import JSON modules. | ||
* | ||
* @default false | ||
*/ | ||
externalizeIconsJson?: boolean; | ||
} | ||
@@ -184,0 +192,0 @@ interface ClientBundleOptions { |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "1.4.3", | ||
"version": "1.4.4", | ||
"builder": { | ||
@@ -10,0 +10,0 @@ "@nuxt/module-builder": "0.8.1", |
import type { IconifyIcon } from '@iconify/types'; | ||
import { init as initClientBundle } from '#build/nuxt-icon-client-bundle'; | ||
export { initClientBundle }; | ||
export declare function loadIcon(name: string): Promise<Required<IconifyIcon> | null>; | ||
export declare function useResolvedName(getName: () => string): import("#imports").ComputedRef<string>; |
import { computed } from "vue"; | ||
import { loadIcons, getIcon as _getIcon } from "@iconify/vue"; | ||
import { useAppConfig } from "#imports"; | ||
import { init } from "#build/nuxt-icon-client-bundle"; | ||
import { init as initClientBundle } from "#build/nuxt-icon-client-bundle"; | ||
export { initClientBundle }; | ||
export async function loadIcon(name) { | ||
if (!name) | ||
return null; | ||
init(); | ||
initClientBundle(); | ||
await new Promise((resolve) => loadIcons([name], () => resolve(true))).catch(() => null); | ||
@@ -10,0 +11,0 @@ return _getIcon(name); |
import { Icon as Iconify, addIcon } from "@iconify/vue"; | ||
import { h } from "vue"; | ||
import { loadIcon, useResolvedName } from "./shared.js"; | ||
import { initClientBundle, loadIcon, useResolvedName } from "./shared.js"; | ||
import { useAsyncData, useNuxtApp, defineComponent, useAppConfig } from "#imports"; | ||
@@ -34,2 +34,4 @@ export const NuxtIconSvg = /* @__PURE__ */ defineComponent({ | ||
addIcon(name.value, payload); | ||
} else { | ||
initClientBundle(); | ||
} | ||
@@ -36,0 +38,0 @@ } |
{ | ||
"name": "@nuxt/icon", | ||
"packageManager": "pnpm@9.6.0", | ||
"version": "1.4.3", | ||
"version": "1.4.4", | ||
"license": "MIT", | ||
@@ -48,2 +48,3 @@ "type": "module", | ||
"local-pkg": "^0.5.0", | ||
"mlly": "^1.7.1", | ||
"pathe": "^1.1.2" | ||
@@ -50,0 +51,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64496
1429
11
+ Addedmlly@^1.7.1