Core: Fix build error without JS engine

This commit is contained in:
fuma-nama
2024-09-03 07:16:08 +08:00
parent 9fb0aec6b8
commit 729928ed18
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'fumadocs-core': patch
---
Fix build error without JS engine
+2 -1
View File
@@ -9,6 +9,7 @@ import type { Processor, Transformer } from 'unified';
import {
getSingletonHighlighter,
createJavaScriptRegexEngine,
createWasmOnigEngine,
type ShikiTransformer,
bundledLanguages,
type BuiltinTheme,
@@ -159,7 +160,7 @@ export function rehypeCode(
const highlighter = getSingletonHighlighter({
engine: codeOptions.experimentalJSEngine
? createJavaScriptRegexEngine()
: undefined,
: createWasmOnigEngine(),
themes: themeItems.filter(Boolean) as BuiltinTheme[],
langs: codeOptions.langs ?? Object.keys(bundledLanguages),
});