question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Large package size

See original GitHub issue

Firstly thank you for this awesome project. I’ve been POCing something with a few different client-side image compressors and yours has the best API and feature set I’ve found. My only qualm is that it is quiet a bit larger than most of the others I’ve found, though I can’t figure out why. I looked through the dependencies and source code and see that the package depends core-js which is also a large package, but it looks like your importing from core-js in a tree-shakable way. So I’m confused as to what is causing the bloat.

So I guess this issue is really a few question:

Do you know what is causing the package to be so much larger than similar packages?

Are there future plans to reduce bundle size?

If you have some guidance on this I’d be happy to work a PR to help trim it down.

Thanks again

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Donaldcwlcommented, Apr 12, 2022

v2.0.0 is released, and the bundle size is half now.

ref: https://bundlephobia.com/package/browser-image-compression@2.0.0

1reaction
Donaldcwlcommented, Apr 11, 2022

Thanks for concerning about the package size, the package indeed increased in size after adding core-js even though tree-shaking has been applied. We decided to remove core-js for polyfill in this project in the next release. By that time, one may need to load polyfill yourself in order to support older browsers.

Such as:

<script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/3.21.1/minified.min.js"></script>
Read more comments on GitHub >

github_iconTop Results From Across the Web

How is the size and weight of a parcel determined?
USPS Retail Ground® items that are between 108 and 130 inches will be charged at the oversized price.
Read more >
Shipping Dimensions and Weight | UPS - United States
Packages can be up to 150 lbs. Packages can be up to 108 inches long. Your specific shipment may have different package size...
Read more >
Package Sizes and Dimensions - USPS Domestic Overview
Domestic Package Size Chart ; Flat Rate Large Box. Priority Mail. 70 lbs. 12-1/4" (L) x 12" (W) x 6" (H) ; Regional...
Read more >
The Cheapest Way to Ship Oversized Packages & Large Items
USPS defines an oversize package as any package over 108” in combined length and girth, but not more than 130”. · UPS considers...
Read more >
How to Measure for a USPS Large Package | Bizfluent
USPS Package Size Limits · Weight: 15 pounds for "Bound Printed Matter," such as catalogs or sales materials, and 70 pounds for all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found