From 1b61fdf038d2627c6dad1a7f1426f60a4616ad93 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Tue, 26 Nov 2024 11:31:32 +0000 Subject: [PATCH] refactor(mdx): add entrypoint as full path file (#12533) Co-authored-by: Princesseuh <3019731+Princesseuh@users.noreply.github.com> --- .changeset/young-terms-hammer.md | 5 +++++ packages/integrations/mdx/src/index.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/young-terms-hammer.md diff --git a/.changeset/young-terms-hammer.md b/.changeset/young-terms-hammer.md new file mode 100644 index 0000000000..7c47ce148c --- /dev/null +++ b/.changeset/young-terms-hammer.md @@ -0,0 +1,5 @@ +--- +'@astrojs/mdx': patch +--- + +Fixes a case where the MDX renderer couldn't be loaded when used as a direct dependency of an Astro integration. diff --git a/packages/integrations/mdx/src/index.ts b/packages/integrations/mdx/src/index.ts index fb6766e5f7..fd2fab8c8b 100644 --- a/packages/integrations/mdx/src/index.ts +++ b/packages/integrations/mdx/src/index.ts @@ -54,7 +54,7 @@ export default function mdx(partialMdxOptions: Partial = {}): AstroI addRenderer({ name: 'astro:jsx', - serverEntrypoint: '@astrojs/mdx/server.js', + serverEntrypoint: new URL('../dist/server.js', import.meta.url), }); addPageExtension('.mdx'); addContentEntryType({