diff --git a/core/docz-core/src/config/argv.ts b/core/docz-core/src/config/argv.ts index 13fb89282..567bde8bf 100644 --- a/core/docz-core/src/config/argv.ts +++ b/core/docz-core/src/config/argv.ts @@ -28,6 +28,7 @@ export interface DocgenConfig { resolver?: (ast: any, recast: any) => any propFilter?: (prop: any) => boolean searchPath: string + searchPatterns: string[] } export interface Menu { diff --git a/core/docz-core/src/states/props.ts b/core/docz-core/src/states/props.ts index edb6820c4..99f55e799 100644 --- a/core/docz-core/src/states/props.ts +++ b/core/docz-core/src/states/props.ts @@ -17,6 +17,10 @@ export const getPattern = (config: Config) => { docgenConfig: docgenConfig, } = config + if (docgenConfig.searchPatterns) { + return docgenConfig.searchPatterns + } + const searchPath = docgenConfig.searchPath ? docgenConfig.searchPath : source const root = paths.getRootDir(config) const srcDir = path.resolve(root, searchPath)