File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import bash from '@shikijs/langs/bash'
44import githubDark from ' @shikijs/themes/github-dark'
55import githubLight from ' @shikijs/themes/github-light'
66import { marked } from ' marked'
7- import { createHighlighterCoreSync } from ' shiki/core'
7+ import { createHighlighterCoreSync , type HighlighterCore } from ' shiki/core'
88import { createJavaScriptRegexEngine } from ' shiki/engine/javascript'
99
1010const props = defineProps <{
@@ -51,7 +51,13 @@ const selectedCommit = shallowRef<
5151const colorMode = useColorMode ()
5252let shiki: HighlighterCore
5353
54- onBeforeMount (() => {
54+ onBeforeMount (async () => {
55+ if (typeof window === ' undefined' ) {
56+ const {loadWasm} = await import (' shiki' )
57+ // @ts-ignore
58+ await loadWasm (import (' shiki/onig.wasm' ))
59+ }
60+
5561 shiki = createHighlighterCoreSync ({
5662 themes: [githubDark , githubLight ],
5763 langs: [bash ],
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ beforeAll(async () => {
3434 server = await app . listen ( 3300 )
3535
3636 await ezSpawn . async (
37- 'pnpm cross-env TEST=true pnpm --filter=app run build' ,
37+ 'pnpm cross-env TEST=true GH_BASE_URL=http://localhost:3300 pnpm --filter=app run build' ,
3838 [ ] ,
3939 {
4040 stdio : 'inherit' ,
You can’t perform that action at this time.
0 commit comments