Files
2024-12-20 11:19:54 +01:00

24 lines
634 B
JavaScript

import path from 'path';
import url from 'url';
/**
* Get the path to the kit, depending on the Pro or Free version.
*/
export function getKitPath() {
let source = path.dirname(
url.fileURLToPath(import.meta.resolve('@fortawesome/fontawesome-free/package.json')),
);
try {
source = path.resolve(
path.dirname(
url.fileURLToPath(import.meta.resolve('@gitbook/fontawesome-pro/package.json')),
),
'icons',
);
} catch (error) {
console.warn('⚠️ Could not find the Pro kit, using the free kit instead');
}
return source;
}