mirror of
https://github.com/iconify/iconify.git
synced 2024-12-13 14:13:06 +00:00
Merge remote-tracking branch 'KermanX/feat/multiple-cwd' into next
This commit is contained in:
commit
c2a76b13ac
@ -15,11 +15,14 @@ export const loadNodeIcon: UniversalIconLoader = async (
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const cwds = Array.isArray(options?.cwd) ? options.cwd : [options?.cwd];
|
||||||
|
|
||||||
|
for (const cwd of cwds) {
|
||||||
const iconSet = await loadCollectionFromFS(
|
const iconSet = await loadCollectionFromFS(
|
||||||
collection,
|
collection,
|
||||||
options?.autoInstall,
|
options?.autoInstall,
|
||||||
undefined,
|
undefined,
|
||||||
options?.cwd
|
cwd
|
||||||
);
|
);
|
||||||
if (iconSet) {
|
if (iconSet) {
|
||||||
result = await searchForIcon(
|
result = await searchForIcon(
|
||||||
@ -28,6 +31,8 @@ export const loadNodeIcon: UniversalIconLoader = async (
|
|||||||
getPossibleIconNames(icon),
|
getPossibleIconNames(icon),
|
||||||
options
|
options
|
||||||
);
|
);
|
||||||
|
if (result) break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result && options?.warn) {
|
if (!result && options?.warn) {
|
||||||
|
@ -183,8 +183,11 @@ export type IconifyLoaderOptions = {
|
|||||||
/**
|
/**
|
||||||
* Current working directory, used to resolve the @iconify-json package.
|
* Current working directory, used to resolve the @iconify-json package.
|
||||||
*
|
*
|
||||||
|
* Can be a string or an array of strings, the first existing path will be used.
|
||||||
|
*
|
||||||
* Only used on `node` environment.
|
* Only used on `node` environment.
|
||||||
|
*
|
||||||
* @default process.cwd()
|
* @default process.cwd()
|
||||||
*/
|
*/
|
||||||
cwd?: string;
|
cwd?: string | string[];
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user