Use zxing-wasm polyfill even if native barcode detector API is available as the polyfill is sometimes better than the native on

See discussion #808 for more infos
This commit is contained in:
Jan Böhmer 2025-01-05 23:43:17 +01:00
parent 6bdf3d891a
commit 614697ba84
3 changed files with 11 additions and 12 deletions

View file

@ -51,7 +51,6 @@ import {
setZXingModuleOverrides,
} from "barcode-detector/pure";
import wasmFile from "../../node_modules/zxing-wasm/dist/reader/zxing_reader.wasm";
setZXingModuleOverrides({
locateFile: (path, prefix) => {
if (path.endsWith(".wasm")) {
@ -59,6 +58,4 @@ setZXingModuleOverrides({
}
return prefix + path;
},
});
//Enable polyfill for the barcode detector. The WASM triggering is done when the barcode detector is used
import "barcode-detector/side-effects";
});