Skip to content

Commit

Permalink
Fix mdx tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Aug 2, 2023
1 parent df42393 commit 2e532e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/astro/src/core/build/plugins/plugin-renderers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export function vitePluginRenderers(opts: StaticBuildOptions): VitePlugin {
exports.push(`export const renderers = [${rendererItems}];`);

return `${imports.join('\n')}\n${exports.join('\n')}`;
} else {
return `export const renderers = [];`;
}
}
},
Expand Down
4 changes: 3 additions & 1 deletion packages/integrations/mdx/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type { Plugin as VitePlugin } from 'vite';
import { getRehypePlugins, getRemarkPlugins, recmaInjectImportMetaEnvPlugin } from './plugins.js';
import type { OptimizeOptions } from './rehype-optimize-static.js';
import { getFileInfo, ignoreStringPlugins, parseFrontmatter } from './utils.js';
import astroJSXRenderer from 'astro/jsx/renderer.js';

export type MdxOptions = Omit<typeof markdownConfigDefaults, 'remarkPlugins' | 'rehypePlugins'> & {
extendMarkdownConfig: boolean;
Expand All @@ -37,9 +38,10 @@ export default function mdx(partialMdxOptions: Partial<MdxOptions> = {}): AstroI
name: '@astrojs/mdx',
hooks: {
'astro:config:setup': async (params) => {
const { updateConfig, config, addPageExtension, addContentEntryType, command } =
const { updateConfig, config, addPageExtension, addContentEntryType, command, addRenderer } =
params as SetupHookParams;

addRenderer(astroJSXRenderer);
addPageExtension('.mdx');
addContentEntryType({
extensions: ['.mdx'],
Expand Down

0 comments on commit 2e532e0

Please sign in to comment.