File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ import type * as typstWeb from "@myriaddreamin/typst.ts";
99import { createTypstCompiler , createTypstRenderer } from "@myriaddreamin/typst.ts" ;
1010import { disableDefaultFontAssets , loadFonts } from "@myriaddreamin/typst.ts/dist/esm/options.init.mjs" ;
1111
12+ // @ts -expect-error ?url import
13+ import mathFontUrl from "/math-font.ttf?url" ;
14+
1215// @ts -expect-error WASM module import
1316import typstCompilerWasm from "@myriaddreamin/typst-ts-web-compiler/pkg/typst_ts_web_compiler_bg.wasm?url" ;
1417// @ts -expect-error WASM module import
@@ -37,9 +40,8 @@ async function initCompiler() {
3740 getModule : ( ) => typstCompilerWasm ,
3841 beforeBuild : [
3942 disableDefaultFontAssets ( ) ,
40- loadFonts ( [
41- "/math-font.ttf" ,
42- ] ) ,
43+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
44+ loadFonts ( [ mathFontUrl ] ) ,
4345 ] ,
4446 } ) ;
4547 console . log ( "Typst compiler initialized" ) ;
You can’t perform that action at this time.
0 commit comments