mirror of
https://github.com/directus/directus.git
synced 2026-01-23 20:18:11 -05:00
Handle monorepos in extension discovery
This commit is contained in:
@@ -8,6 +8,9 @@ import { pluralize } from './pluralize';
|
||||
|
||||
export async function getPackageExtensions(root: string): Promise<Extension[]> {
|
||||
const pkg = await fse.readJSON(path.resolve(path.join(root, 'package.json')));
|
||||
|
||||
if (!pkg.dependencies) return [];
|
||||
|
||||
const extensionNames = Object.keys(pkg.dependencies).filter((dep) => EXTENSION_NAME_REGEX.test(dep));
|
||||
|
||||
return listExtensionsChildren(extensionNames);
|
||||
|
||||
Reference in New Issue
Block a user