Skip to content

Commit 18e7fb9

Browse files
authoredMar 20, 2025··
fix: allow override NextraConfig.mdxOptions.format option in next.config file (#4373)
1 parent a7db0e6 commit 18e7fb9

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed
 

‎.changeset/light-walls-end.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"nextra": patch
3+
---
4+
5+
fix: allow override `NextraConfig.mdxOptions.format` option in `next.config` file

‎packages/nextra/src/server/loader.ts

-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ export async function loader(
132132
...mdxOptions,
133133
jsx: true,
134134
outputFormat: 'program',
135-
format: 'detect',
136135
rehypePrettyCodeOptions: {
137136
...mdxOptions.rehypePrettyCodeOptions,
138137
transformers: [

‎packages/nextra/src/server/schemas.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const nextraConfigSchema = z.strictObject({
5252
rehypePlugins: z.custom<ProcessorOptions['rehypePlugins']>(),
5353
remarkPlugins: z.custom<ProcessorOptions['remarkPlugins']>(),
5454
recmaPlugins: z.custom<ProcessorOptions['recmaPlugins']>(),
55-
format: z.enum(['detect', 'mdx', 'md']).optional(),
55+
format: z.enum(['detect', 'mdx', 'md']).default('detect'),
5656
rehypePrettyCodeOptions: z.custom<RehypePrettyCodeOptions>().default({})
5757
})
5858
.default({}),

0 commit comments

Comments
 (0)
Please sign in to comment.