style: format MuPDF dev loading files

This commit is contained in:
Weilin Cai 2026-04-07 16:19:01 +08:00
parent 1c4eaf3e6d
commit 7ab99b5b5e
2 changed files with 6 additions and 6 deletions

View file

@ -6,9 +6,11 @@ type MupdfWasmModuleConfig = {
locateFile?: (path: string) => string;
};
const wasmModuleConfig = ((globalThis as typeof globalThis & {
$libmupdf_wasm_Module?: MupdfWasmModuleConfig;
}).$libmupdf_wasm_Module ??= {});
const wasmModuleConfig = ((
globalThis as typeof globalThis & {
$libmupdf_wasm_Module?: MupdfWasmModuleConfig;
}
).$libmupdf_wasm_Module ??= {});
// In Vite dev, requests for /node_modules/.../mupdf-wasm.wasm can fall back to
// index.html. Pointing MuPDF at Vite's @fs URL keeps worker startup on the

View file

@ -22,9 +22,7 @@ export default defineConfig({
},
},
define: {
__MUPDF_WASM_FS_PATH__: JSON.stringify(
mupdfWasmFile.replace(/\\/g, "/"),
),
__MUPDF_WASM_FS_PATH__: JSON.stringify(mupdfWasmFile.replace(/\\/g, "/")),
},
worker: {
format: "es",