Skip to content

Commit

Permalink
Merge pull request #9 from joshwooding/support-skipcsf-compile
Browse files Browse the repository at this point in the history
Support skipCsf option in compile functions
  • Loading branch information
shilman authored Jun 22, 2022
2 parents f2ffa03 + 658e02b commit 7a6c370
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
1 change: 1 addition & 0 deletions src/sb-mdx-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface MdxOptions {
wrapExport?: string;
remarkPlugins?: any[];
rehypePlugins?: any[];
skipCsf?: boolean;
}

interface CompilerOptions {
Expand Down

0 comments on commit 7a6c370

Please sign in to comment.