mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #357] [MERGED] fix(mdx): skip ?raw and other query imports in vinext:mdx transform #506
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#506
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/357
Author: @james-elicx
Created: 3/8/2026
Status: ✅ Merged
Merged: 3/8/2026
Merged by: @james-elicx
Base:
main← Head:fix/mdx-skip-query-imports📝 Commits (1)
44a5d84fix(mdx): skip ?raw and other query imports in vinext:mdx transform📊 Changes
2 files changed (+55 additions, -0 deletions)
View changed files
📝
packages/vinext/src/index.ts(+3 -0)📝
tests/pages-router.test.ts(+52 -0)📄 Description
Summary
@mdx-js/rollupstrips the query string before matching file extensions, so without a guard it compilesfoo.mdx?rawas MDX and returns compiled JSX instead of raw textvinext:mdxproxy'stransformhook now returns early whenid.includes('?'), matching Vite's own convention for query importsChanges
packages/vinext/src/index.tsif (id.includes('?')) return;as the first line of thevinext:mdxtransformhooktests/pages-router.test.ts"vinext:mdx transform skips ids that contain a query string (regression: ?raw)"— asserts the real proxy plugin returnsundefinedfor?raw,?url, and?inlineids"vinext:mdx proxy logic — ?raw guard prevents delegate from compiling query imports"— self-contained unit test with a mock delegate that demonstrates both the broken behavior (without guard) and the fixed behavior (with guard)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.