mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +02:00
fix(v2): use swizzled SearchPage component if any (#3721)
* fix(v2): use swizzled SearchPage component if any * Fix dependency cycles warning
This commit is contained in:
parent
702fc15c8e
commit
8ef7c24583
3 changed files with 20 additions and 3 deletions
|
@ -463,3 +463,17 @@ export function reportMessage(
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function getSwizzledComponent(
|
||||
componentPath: string,
|
||||
): string | undefined {
|
||||
const swizzledComponentPath = path.resolve(
|
||||
process.cwd(),
|
||||
'src',
|
||||
componentPath,
|
||||
);
|
||||
|
||||
return fs.existsSync(swizzledComponentPath)
|
||||
? swizzledComponentPath
|
||||
: undefined;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue