Skip to content

Commit 7ad874e

Browse files
committed
fix(plugin-code): module not found error
1 parent 545864a commit 7ad874e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/plugin-code/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { DualTheme, Theme, isSingleTheme, type Plugin } from 'carta-md';
2-
import { type RehypeShikiOptions } from '@shikijs/rehype';
1+
import type { DualTheme, Theme, Plugin } from 'carta-md';
2+
import type { RehypeShikiOptions } from '@shikijs/rehype';
33
import rehypeShikiFromHighlighter from '@shikijs/rehype/core';
44

55
export type CodeExtensionOptions = Omit<RehypeShikiOptions, 'theme' | 'themes'> & {
@@ -17,6 +17,7 @@ export const code = (options?: CodeExtensionOptions): Plugin => {
1717
type: 'rehype',
1818
async transform({ processor, carta }) {
1919
let theme = options?.theme;
20+
const { isSingleTheme } = await import('carta-md');
2021
const highlighter = await carta.highlighter();
2122
if (!theme) {
2223
theme = highlighter.theme; // Use the theme specified in the highlighter

0 commit comments

Comments
 (0)