Fix the _mdast export with removePosition
// fumadocs-mdx collection config
postprocess: {
includeMDAST: { removePosition: true },
},This exported _mdast with no value, and getMDAST() then reported that includeMDAST was disabled. removePosition strips positions in place and returns nothing, so JSON.stringify received undefined.
The tree is now cloned, stripped, and serialized from the clone.
Fix SOURCEMAP_BROKEN warnings on Vite
With build.sourcemap enabled, Vite warned once per content and meta file because the loaders returned no source map. They now return an empty map when nothing is generated.
Source maps for MDX stay opt-in, pass SourceMapGenerator from source-map to MDX options:
import { SourceMapGenerator } from 'source-map';
export default defineConfig({
mdxOptions: {
SourceMapGenerator,
},
});