fix(mdx): fix compatibility with ?raw query string

This commit is contained in:
Fuma Nama
2026-05-23 00:37:38 +08:00
parent a272056c64
commit 39376ebbb8
2 changed files with 11 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-mdx': patch
---
Fix compatibility with `?raw` query string
+6 -1
View File
@@ -108,9 +108,14 @@ export function toVite(loader: Loader): ViteLoader {
const [file, query = ''] = id.split('?', 2);
try {
const parsedQuery = parse(query);
if ('raw' in parsedQuery) {
return null;
}
const result = await loader.load({
filePath: file,
query: parse(query),
query: parsedQuery,
getSource() {
return value;
},