refactor/deps(frontend): shikiのdeprecated表現を修正 (#15169)
* fix(frontend): shikiのdeprecated表現を修正
* update aiscript-vscode
* ✌️
* fix
* remove unused imports
* bump aiscript-vscode to 0.1.15
This commit is contained in:
parent
c4192e81ed
commit
d60c307c4e
4 changed files with 14 additions and 14 deletions
|
|
@ -3,7 +3,8 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { createHighlighterCore, loadWasm } from 'shiki/core';
|
||||
import { createHighlighterCore } from 'shiki/core';
|
||||
import { createOnigurumaEngine } from 'shiki/engine/oniguruma';
|
||||
import darkPlus from 'shiki/themes/dark-plus.mjs';
|
||||
import { bundledThemesInfo } from 'shiki/themes';
|
||||
import { bundledLanguagesInfo } from 'shiki/langs';
|
||||
|
|
@ -60,8 +61,6 @@ export async function getHighlighter(): Promise<HighlighterCore> {
|
|||
}
|
||||
|
||||
async function initHighlighter() {
|
||||
await loadWasm(import('shiki/onig.wasm?init'));
|
||||
|
||||
// テーマの重複を消す
|
||||
const themes = unique([
|
||||
darkPlus,
|
||||
|
|
@ -70,6 +69,7 @@ async function initHighlighter() {
|
|||
|
||||
const jsLangInfo = bundledLanguagesInfo.find(t => t.id === 'javascript');
|
||||
const highlighter = await createHighlighterCore({
|
||||
engine: createOnigurumaEngine(() => import('shiki/onig.wasm?init')),
|
||||
themes,
|
||||
langs: [
|
||||
...(jsLangInfo ? [async () => await jsLangInfo.import()] : []),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue