Skip to content

Commit

Permalink
perf(plugin-md-power): use engine instead of loadWasm in codeEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
pengzhanbo committed Sep 30, 2024
1 parent ebef7e6 commit 5c4cbd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/plugin-md-power/src/client/components/CodeEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { HighlighterCore } from 'shiki/core'
import editorData from '@internal/md-power/replEditorData'
import { createHighlighterCore } from 'shiki/core'
import { createOnigurumaEngine } from 'shiki/engine/oniguruma'
import { onMounted, onUnmounted, ref, shallowRef, watch } from 'vue'
import { resolveCodeInfo } from '../composables/codeRepl.js'
Expand All @@ -20,7 +21,7 @@ async function init() {
highlighter = await createHighlighterCore({
themes: 'light' in theme && 'dark' in theme ? [theme.light, theme.dark] : [theme],
langs: Object.keys(grammars).map(key => grammars[key]),
loadWasm: () => import('shiki/wasm'),
engine: createOnigurumaEngine(() => import('shiki/wasm')),
})
}
Expand Down

0 comments on commit 5c4cbd2

Please sign in to comment.