evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
Create a utility that compiles MDX content containing export-all statements using the @mdx-js/mdx compiler.
Your task is to build a compiler function that:
The function should properly handle MDX files that use the export * from syntax to re-export all exports from other modules.
The function should accept:
export * from './module' statementsThe function should return an object with two properties:
program: The compiled code in program format (default ES module format)functionBody: The compiled code in function-body formatGiven MDX source that re-exports from multiple modules:
# Component Library
export * from './buttons'
export * from './inputs'
export const version = '1.0.0'The compiler should produce valid JavaScript in both output formats that properly handles the export-all statements.
/**
* Compiles MDX source code in both output formats
*
* @param {string} mdxSource - MDX source code containing export statements
* @returns {Promise<{program: string, functionBody: string}>} Compiled code in both formats
*/
export async function compileMdxWithExports(mdxSource) {
// Implementation here
}Provides MDX compilation support for transforming MDX files into JavaScript modules.