@@ -22,7 +22,7 @@ export const buildDocs = async (
22
22
extra : { instanceDate : string ; instanceFile : string } ,
23
23
// eslint-disable-next-line max-params
24
24
) => {
25
- const { packages, tsConfigPath, addMonorepoPage = true } = pluginOptions ;
25
+ const { packages, tsConfigPath, addMonorepoPage = true , addPackagePage = true } = pluginOptions ;
26
26
const isMonorepo = packages . length > 1 ;
27
27
28
28
const isEnabledMonorepo = packages . filter ( ( pkg ) => pkg . generateMdx ) . length > 1 ;
@@ -56,7 +56,7 @@ export const buildDocs = async (
56
56
packageOptionsPath,
57
57
mdxOutDir,
58
58
packageDocsJsonPath,
59
- addPackagePage = true ,
59
+ hasPackagePage ,
60
60
} = getPackageOptions ( packages , packageOptions , docsGenerationDir , generatedFilesDir , tsConfigPath , isMonorepo ) ;
61
61
62
62
/**
@@ -65,10 +65,12 @@ export const buildDocs = async (
65
65
trace ( `Setup package directories for ${ cleanFileName ( packageOptions . title ) } ` , packageName ) ;
66
66
createFile ( packageOptionsPath , JSON . stringify ( pkgMeta ) ) ;
67
67
68
+ const shouldCreateIndexPage = hasPackagePage !== undefined ? hasPackagePage : addPackagePage ;
69
+
68
70
/**
69
71
* Generate package page from readme or custom setup
70
72
*/
71
- if ( pluginOptions . generateMdx && addPackagePage ) {
73
+ if ( pluginOptions . generateMdx && shouldCreateIndexPage ) {
72
74
trace ( `Generating package page` , packageName ) ;
73
75
generatePackagePage ( mdxOutDir , packageOptions ) ;
74
76
}
0 commit comments