fix: only-if-esm for getWasmUrl

This commit is contained in:
alina 🌸 2024-03-04 05:48:38 +03:00
parent 399336fa4a
commit fea8d93dcb
Signed by: teidesu
SSH key fingerprint: SHA256:uNeCpw6aTSU4aIObXLvHfLkDa82HWH9EiOj9AXOIRpI

View file

@ -8,7 +8,10 @@ export function getWasmUrl(): URL {
// making it not work. probably related to https://github.com/vitejs/vite/issues/8427,
// but asking the user to deoptimize the entire @mtcute/web is definitely not a good idea
// so we'll just use this hack for now
// @only-if-esm
return new URL('../mtcute.wasm', import.meta.url)
// @/only-if-esm
throw new Error('ESM-only')
}
let wasm!: MtcuteWasmModule