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:
Alexey Pyltsyn 2020-11-12 19:01:46 +03:00 committed by GitHub
parent 702fc15c8e
commit 8ef7c24583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View file

@ -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;
}