diff --git a/packages/integrations/mdx/src/index.ts b/packages/integrations/mdx/src/index.ts index 8b2924483..d4b30d633 100644 --- a/packages/integrations/mdx/src/index.ts +++ b/packages/integrations/mdx/src/index.ts @@ -1,7 +1,9 @@ import { compile as mdxCompile } from '@mdx-js/mdx'; +import { VFile } from 'vfile'; import { PluggableList } from '@mdx-js/mdx/lib/core.js'; import mdxPlugin, { Options as MdxRollupPluginOptions } from '@mdx-js/rollup'; import type { AstroIntegration } from 'astro'; +import type { Plugin as VitePlugin } from 'vite'; import { parse as parseESM } from 'es-module-lexer'; import { blue, bold } from 'kleur/colors'; import fs from 'node:fs/promises'; @@ -12,7 +14,6 @@ import { recmaInjectImportMetaEnvPlugin, rehypeApplyFrontmatterExport, } from './plugins.js'; -import { getFileInfo, handleExtendsNotSupported, parseFrontmatter } from './utils.js'; const RAW_CONTENT_ERROR = 'MDX does not support rawContent()! If you need to read the Markdown contents to calculate values (ex. reading time), we suggest injecting frontmatter via remark plugins. Learn more on our docs: https://docs.astro.build/en/guides/integrations-guide/mdx/#inject-frontmatter-via-remark-or-rehype-plugins'; diff --git a/packages/integrations/mdx/src/plugins.ts b/packages/integrations/mdx/src/plugins.ts index 6d3948da0..d4e4cfe9f 100644 --- a/packages/integrations/mdx/src/plugins.ts +++ b/packages/integrations/mdx/src/plugins.ts @@ -6,19 +6,14 @@ import { jsToMdxTreeNode } from './internal-utils.js'; import { nodeTypes } from '@mdx-js/mdx'; import type { PluggableList } from '@mdx-js/mdx/lib/core.js'; import type { Options as MdxRollupPluginOptions } from '@mdx-js/rollup'; -import type { AstroConfig, MarkdownAstroData } from 'astro'; -import type { Literal, MemberExpression } from 'estree'; -import { visit as estreeVisit } from 'estree-util-visit'; import { bold, yellow } from 'kleur/colors'; import rehypeRaw from 'rehype-raw'; import remarkGfm from 'remark-gfm'; import remarkSmartypants from 'remark-smartypants'; -import type { Data, VFile } from 'vfile'; import { MdxOptions } from './index.js'; import rehypeCollectHeadings from './rehype-collect-headings.js'; import remarkPrism from './remark-prism.js'; import remarkShiki from './remark-shiki.js'; -import { jsToTreeNode } from './utils.js'; export function recmaInjectImportMetaEnvPlugin({ importMetaEnv,