diff options
author | 2023-02-23 16:20:06 +0100 | |
---|---|---|
committer | 2023-02-23 09:20:06 -0600 | |
commit | 075b87e8b72a69a608cd2ff1196dc0989e2cf1e1 (patch) | |
tree | 7c0baa3608122394eb382c0324231d20071486f6 /packages/integrations/mdx/src | |
parent | f91a7f376c223f18b4d8fbed81f95f6bea1cef8d (diff) | |
download | astro-075b87e8b72a69a608cd2ff1196dc0989e2cf1e1.tar.gz astro-075b87e8b72a69a608cd2ff1196dc0989e2cf1e1.tar.zst astro-075b87e8b72a69a608cd2ff1196dc0989e2cf1e1.zip |
Update MDX integration to es-module-lexer@1.1.1 (#6296)
* Update MDX integration to es-module-lexer@1.1.1
* Added missing pnpm-lock.yaml file
* Create lucky-flowers-wonder.md
---------
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/mdx/src')
-rw-r--r-- | packages/integrations/mdx/src/index.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/integrations/mdx/src/index.ts b/packages/integrations/mdx/src/index.ts index 7012849a4..ecd7b7b43 100644 --- a/packages/integrations/mdx/src/index.ts +++ b/packages/integrations/mdx/src/index.ts @@ -112,13 +112,13 @@ export default function mdx(partialMdxOptions: Partial<MdxOptions> = {}): AstroI } const { fileUrl, fileId } = getFileInfo(id, config); - if (!moduleExports.includes('url')) { + if (!moduleExports.find(({n}) => n === 'url')) { code += `\nexport const url = ${JSON.stringify(fileUrl)};`; } - if (!moduleExports.includes('file')) { + if (!moduleExports.find(({n}) => n === 'file')) { code += `\nexport const file = ${JSON.stringify(fileId)};`; } - if (!moduleExports.includes('Content')) { + if (!moduleExports.find(({n}) => n === 'Content')) { // Make `Content` the default export so we can wrap `MDXContent` and pass in `Fragment` code = code.replace('export default MDXContent;', ''); code += `\nexport const Content = (props = {}) => MDXContent({ |