chore: switch to shiki-es

This commit is contained in:
Anthony Fu 2022-11-30 13:45:42 +08:00
parent db5a022f3b
commit 04431c7319
4 changed files with 13 additions and 6 deletions

View file

@ -1,4 +1,4 @@
import type { Highlighter, Lang } from 'shiki'
import type { Highlighter, Lang } from 'shiki-es'
export const shiki = ref<Highlighter>()
@ -7,7 +7,7 @@ let shikiImport: Promise<void> | undefined
export function highlightCode(code: string, lang: Lang) {
if (!shikiImport) {
shikiImport = import('shiki')
shikiImport = import('shiki-es')
.then(async (r) => {
r.setCDN('/shiki/')
shiki.value = await r.getHighlighter({