Optimize z-related components: Bundle analyzer, Brotli compression, ZXing lazy loading

Co-authored-by: jbtronics <5410681+jbtronics@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-09-21 14:12:32 +00:00
parent cb26e6d181
commit 130b08090a
4 changed files with 45 additions and 16 deletions

View file

@ -33,6 +33,11 @@ export default class extends Controller {
connect() {
console.log('Init Scanner');
// Configure ZXing WASM when scanner is actually used (optimization)
import('../../js/zxing_config').then(({ configureZXing }) => {
configureZXing();
}).catch(console.error);
//This function ensures, that the qrbox is 70% of the total viewport
let qrboxFunction = function(viewfinderWidth, viewfinderHeight) {
let minEdgePercentage = 0.7; // 70%