Skip to content

Commit

Permalink
Core: lazy load highlighter
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Dec 7, 2024
1 parent bebb16b commit fefb78f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/utils/shiki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
type CodeOptionsMeta,
type HighlighterCoreOptions,
type CodeToHastOptionsCommon,
getSingletonHighlighter,
} from 'shiki';
import type { BundledTheme } from 'shiki/themes';
import { type Components, toJsxRuntime } from 'hast-util-to-jsx-runtime';
Expand Down Expand Up @@ -43,6 +42,7 @@ export async function highlight(
code: string,
options: HighlightOptions,
): Promise<ReactNode> {
const { getSingletonHighlighter } = await import('shiki');
const { lang, components, engine: defaultEngine, ...rest } = options;

let themes: CodeOptionsThemes<BundledTheme> = { themes: defaultThemes };
Expand Down

0 comments on commit fefb78f

Please sign in to comment.