Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement] Tree shaking bundle #107

Open
Roman991 opened this issue Jan 23, 2023 · 1 comment
Open

[Improvement] Tree shaking bundle #107

Roman991 opened this issue Jan 23, 2023 · 1 comment

Comments

@Roman991
Copy link

This is the code

import { BarcodeFormat, DecodeHintType } from '@zxing/library';
import {
    BrowserCodeReader,
    IScannerControls,
    BrowserMultiFormatReader,
} from '@zxing/browser';

const hints = new Map();
const formats = [
    BarcodeFormat.EAN_13,
    BarcodeFormat.EAN_8,
    // BarcodeFormat.CODABAR,
];
hints.set(DecodeHintType.POSSIBLE_FORMATS, formats);
const codeReader = new BrowserMultiFormatReader(hints);
this.controls = await codeReader.decodeFromVideoDevice(
....
);

image
And this is the import size 1.2MB,
Idk if its more related to this or to the parent library

@myasul
Copy link

myasul commented Feb 12, 2023

I also have this problem. Is it possible to reduce the bundle size? This is the biggest package I have on my app.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants