Skip to content

Commit

Permalink
fix: use shiki intead of shikiji
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Apr 2, 2024
1 parent dda3280 commit a5fb9e4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
"prettier": "3.2.5",
"prettier-plugin-toml": "2.0.1",
"sass": "1.72.0",
"shikiji": "0.10.2",
"shiki": "1.2.3",
"stylelint": "16.3.1",
"stylelint-config-html": "1.1.0",
"stylelint-config-recess-order": "5.0.0",
Expand Down
29 changes: 19 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions src/utils/shiki.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import type { Highlighter } from "shikiji";
import { getHighlighterCore } from "shikiji/core";
import type { Highlighter } from "shiki";
import { getHighlighterCore } from "shiki/core";

import minLight from "shikiji/themes/min-light.mjs";
import nord from "shikiji/themes/nord.mjs";
import getWasm from "shikiji/wasm";
import minLight from "shiki/themes/min-light.mjs";
import nord from "shiki/themes/nord.mjs";
import getWasm from "shiki/wasm";

let shiki: Highlighter | null = null;

export async function getShikiSingleton() {
if (!shiki) {
shiki = await getHighlighterCore({
shiki = (await getHighlighterCore({
themes: [nord, minLight],
langs: [],

loadWasm: getWasm,
});
})) as Highlighter;
}
return shiki;
}
Expand Down

0 comments on commit a5fb9e4

Please sign in to comment.