@@ -76,19 +76,22 @@ export default argv => {
7676 // create a list of plugin pages.
7777 const pluginPages = new Map ( )
7878
79- Object . keys ( packageJson . dependencies )
80- . filter ( depend => depend . startsWith ( 'wiki-plugin' ) )
81- . forEach ( plugin => {
82- const pagesPath = path . join ( path . dirname ( require . resolve ( `${ plugin } /package` ) ) , 'pages' )
83- fs . readdir ( pagesPath , { withFileTypes : true } , ( err , entries ) => {
84- if ( err ) return
85- entries . forEach ( entry => {
86- if ( entry . isFile ( ) && ! pluginPages . has ( entry . name ) ) {
87- pluginPages . set ( entry . name , { pluginName : plugin , pluginPath : entry . parentPath } )
88- }
89- } )
79+ const dependencyPlugins = Object . keys ( packageJson . dependencies ) . filter ( depend => depend . startsWith ( 'wiki-plugin' ) )
80+ const plugins = dependencyPlugins . length
81+ ? dependencyPlugins
82+ : Object . keys ( packageJson . devDependencies ) . filter ( depend => depend . startsWith ( 'wiki-plugin' ) )
83+
84+ plugins . forEach ( plugin => {
85+ const pagesPath = path . join ( path . dirname ( require . resolve ( `${ plugin } /package` ) ) , 'pages' )
86+ fs . readdir ( pagesPath , { withFileTypes : true } , ( err , entries ) => {
87+ if ( err ) return
88+ entries . forEach ( entry => {
89+ if ( entry . isFile ( ) && ! pluginPages . has ( entry . name ) ) {
90+ pluginPages . set ( entry . name , { pluginName : plugin , pluginPath : entry . parentPath } )
91+ }
9092 } )
9193 } )
94+ } )
9295
9396 // #### Private utility methods. ####
9497 const load_parse = ( loc , cb , annotations = { } ) => {
0 commit comments