diff --git a/core/docz-core/src/config/argv.ts b/core/docz-core/src/config/argv.ts index e05cb1c37..3a6b5c08a 100644 --- a/core/docz-core/src/config/argv.ts +++ b/core/docz-core/src/config/argv.ts @@ -27,6 +27,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)