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

Reduce CRX size by setting zlib compression level #128

Closed
scholtzm opened this issue Apr 28, 2021 · 1 comment
Closed

Reduce CRX size by setting zlib compression level #128

scholtzm opened this issue Apr 28, 2021 · 1 comment
Labels
Milestone

Comments

@scholtzm
Copy link

scholtzm commented Apr 28, 2021

I tested packaging our extension using the built-in tool in Chrome browser vs. this module and the size difference can be pretty large -- in our case it's ~700kB smaller when using the Chrome browser.

After short investigation, I have found out that if you pass level 9 ("best compression") to zlib, size of the package will be reduced to similar size. The CRX will load just fine in Chrome browser.

For now, I have hard patched the module in node_modules folder but this is not ideal.

https://github.com/oncletom/crx/blob/master/src/index.js#L130

- var archive = archiver("zip");
+ var archive = archiver("zip", { zlib: { level: 9 }});
@thom4parisot
Copy link
Owner

Hi there,

Can you open a pull request with this exact change?

Otherwise I’ll do it when I get my computer out of repair.

@thom4parisot thom4parisot added this to the v5.1 milestone Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants