Commit 4d0d2e3 1 parent 078cac0 commit 4d0d2e3 Copy full SHA for 4d0d2e3
File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -140,10 +140,32 @@ export async function serveProject(
140
140
throw new Error ( `${ target } is not a project` ) ;
141
141
}
142
142
143
+ const isDocusaurusMd = (
144
+ format ?: string | Record < string , unknown > | unknown ,
145
+ ) => {
146
+ if ( ! format ) {
147
+ return false ;
148
+ }
149
+
150
+ if ( typeof format === "string" ) {
151
+ return format === "docusaurus-md" ;
152
+ } else if ( typeof format === "object" ) {
153
+ const formats = Object . keys ( format ) ;
154
+ if ( formats . length > 0 ) {
155
+ const firstFormat = Object . keys ( format ) [ 0 ] ;
156
+ return firstFormat === "docusaurus-md" ;
157
+ } else {
158
+ return false ;
159
+ }
160
+ } else {
161
+ return false ;
162
+ }
163
+ } ;
164
+
143
165
// Default project types can't be served
144
166
const projType = projectType ( project ?. config ?. project ?. [ kProjectType ] ) ;
145
167
if (
146
- projType . type === "default" && project ?. config ?. format !== "docusaurus-md"
168
+ projType . type === "default" && ! isDocusaurusMd ( project ?. config ?. format )
147
169
) {
148
170
const hasIndex = project . files . input . some ( ( file ) => {
149
171
let relPath = file ;
You can’t perform that action at this time.
0 commit comments