Skip to content

Commit 9d8e946

Browse files
committed
fix: detect mdx files using full extension
1 parent 2bda7fb commit 9d8e946

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.changeset/lazy-zebras-invent.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@astrojs/mdx': patch
3+
'astro': patch
4+
---
5+
6+
Detect `mdx` files using their full extension

packages/astro/src/content/runtime.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ async function render({
306306

307307
let props = baseProps;
308308
// Auto-apply MDX components export
309-
if (id.endsWith('mdx')) {
309+
if (id.endsWith('.mdx')) {
310310
props = {
311311
components: mod.components ?? {},
312312
...baseProps,

packages/integrations/mdx/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default function mdx(partialMdxOptions: Partial<MdxOptions> = {}): AstroI
9595
// Override transform to alter code before MDX compilation
9696
// ex. inject layouts
9797
async transform(_, id) {
98-
if (!id.endsWith('mdx')) return;
98+
if (!id.endsWith('.mdx')) return;
9999

100100
// Read code from file manually to prevent Vite from parsing `import.meta.env` expressions
101101
const { fileId } = getFileInfo(id, config);

0 commit comments

Comments
 (0)