diff --git a/src/index.ts b/src/index.ts index ab8d5f4..74b0f56 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,9 +2,9 @@ import mdx from '@mdx-js/mdx'; import { createCompiler, MdxOptions } from './sb-mdx-plugin'; export const compile = async (code: string, options?: MdxOptions) => - mdx(code, { compilers: [createCompiler(options)] }); + mdx(code, { compilers: options?.skipCsf ? undefined : [createCompiler(options)] }); export const compileSync = (code: string, options?: MdxOptions) => - mdx.sync(code, { compilers: [createCompiler(options)] }); + mdx.sync(code, { compilers: options?.skipCsf ? undefined : [createCompiler(options)] }); export * from './sb-mdx-plugin'; diff --git a/src/sb-mdx-plugin.ts b/src/sb-mdx-plugin.ts index 6697972..f32b754 100644 --- a/src/sb-mdx-plugin.ts +++ b/src/sb-mdx-plugin.ts @@ -14,6 +14,7 @@ export interface MdxOptions { wrapExport?: string; remarkPlugins?: any[]; rehypePlugins?: any[]; + skipCsf?: boolean; } interface CompilerOptions {