Skip to content

Commit

Permalink
fix(vite): rm useless shikiji langs support (#267)
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Jan 15, 2024
1 parent 10cccc1 commit 7768255
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/utils/shiki.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import { getHighlighter, type Highlighter } from "shikiji";
import type { Highlighter } from "shikiji";
import { getHighlighterCore } from "shikiji/core";

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

let shiki: Highlighter | null = null;

export async function getShikiSingleton() {
if (!shiki) {
shiki = await getHighlighter({
themes: ["nord", "min-light"],
langs: ["ansi"],
shiki = await getHighlighterCore({
themes: [nord, minLight],
langs: [],

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

0 comments on commit 7768255

Please sign in to comment.