diff --git a/src/lib/components/fitness/FoodSearch.svelte b/src/lib/components/fitness/FoodSearch.svelte index a8862a6..1dce6ba 100644 --- a/src/lib/components/fitness/FoodSearch.svelte +++ b/src/lib/components/fitness/FoodSearch.svelte @@ -216,13 +216,11 @@ const mod = await import('barcode-detector/ponyfill'); BarcodeDetector = mod.BarcodeDetector; - // Point ZXing WASM to our self-hosted copy via Vite ?url import - const { prepareZXingModule } = await import('barcode-detector/ponyfill'); - const wasmModule = await import('zxing-wasm/reader/zxing_reader.wasm?url'); - prepareZXingModule({ + // Point ZXing WASM to our self-hosted copy in /static + mod.prepareZXingModule({ overrides: { locateFile: (path, prefix) => { - if (path.endsWith('.wasm')) return wasmModule.default; + if (path.endsWith('.wasm')) return '/fitness/zxing_reader.wasm'; return prefix + path; }, }, diff --git a/static/fitness/zxing_reader.wasm b/static/fitness/zxing_reader.wasm new file mode 100644 index 0000000..76d83a0 Binary files /dev/null and b/static/fitness/zxing_reader.wasm differ