diff options
Diffstat (limited to 'packages/integrations/mdx')
-rw-r--r-- | packages/integrations/mdx/CHANGELOG.md | 4 | ||||
-rw-r--r-- | packages/integrations/mdx/package.json | 4 | ||||
-rw-r--r-- | packages/integrations/mdx/src/index.ts | 6 |
3 files changed, 9 insertions, 5 deletions
diff --git a/packages/integrations/mdx/CHANGELOG.md b/packages/integrations/mdx/CHANGELOG.md index 074162dc2..59d299960 100644 --- a/packages/integrations/mdx/CHANGELOG.md +++ b/packages/integrations/mdx/CHANGELOG.md @@ -1,5 +1,9 @@ # @astrojs/mdx +## 0.17.1 + +- Updated to es-module-lexer@1.1.1 + ## 0.17.0 ### Minor Changes diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index 5d69781a8..1e526bbc5 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -1,7 +1,7 @@ { "name": "@astrojs/mdx", "description": "Use MDX within Astro", - "version": "0.17.0", + "version": "0.17.1", "type": "module", "types": "./dist/index.d.ts", "author": "withastro", @@ -35,7 +35,7 @@ "@mdx-js/mdx": "^2.3.0", "@mdx-js/rollup": "^2.3.0", "acorn": "^8.8.0", - "es-module-lexer": "^0.10.5", + "es-module-lexer": "^1.1.1", "estree-util-visit": "^1.2.0", "github-slugger": "^1.4.0", "gray-matter": "^4.0.3", 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({ |