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.

Undesirable 92KB Bundle Size Increase at v1.11.0

See original GitHub issue

I’m experiencing a bundle size increase of 92KB after upgrading from v1.10.0 to v1.11.0.

I suspect this is due to the addition of Babel-Polyfill, which adds all of core-js and regenerator-runtime to the bundle.

Before upgrading my main.js bundle was 213KB, and after upgrading it is 305KB, an increase of 43%.

I am of the opinion that opting into polyfills for IE support should be done at the app level, rather than the library level. In my own case, I have next-auth as a dependency, and would rather not include the babel-polyfill code in my code’s bundle, and also would rather not take on babel-polyfill, core-js, and regenerator-runtime as transitive dependencies. My app has no intention of supporting IE, and I’m trying to keep the bundle as small as possible, so I personally would rather not include these polyfills. I’m sure others would also take issue with the inclusion of these polyfills.

The change made in v1.11.0 makes it impossible to opt out of including these polyfills.

Would you kindly consider removing babel-polyfill as a dependency of this library, and instead encourage your users who need IE support to add it to their app’s codebase instead? Thank you very much.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
masonecommented, Mar 7, 2019

Importing next-auth/client results in a

Error: only one instance of babel-polyfill is allowed

for us. I assume it’s because we handle polyfilling ourselves in our custom webpack config already. Any advice on how I can proceed?

0reactions
LoriKarikaricommented, May 24, 2020

v2 is out now and v1 isn’t supported anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Methods to Reduce JavaScript Bundle Size - Bits and Pieces
4. Compressing Bundles. If your application bundle size increases and affects performance, you can compress them to reduce the size. Gzip and ...
Read more >
Small Bundles, Fast Pages: What To Do With Too Much ...
This post will explain why bundle size matters and recommend tools and processes you can follow to monitor, visualise, and most importantly, ...
Read more >
TS increase the bundle size of my site significantly : r/reactjs
I'm using gatsby-plugin-webpack-bundle-analyser-v2 to analyze the bundle size, which is essentially a wrapper of webpack-bundle-analyzer .
Read more >
Your Bundle Size impacts your Users | by Evan Williams
The resulting bundle can be extremely large. This is especially true if styles, images, fonts, etc are all built into your bundle. As...
Read more >
How to decrease prod bundle size? - angular - Stack Overflow
With this import change our unpacked bundle size decreased from 1.0MB to 663kB (213.4kB -> 126kB packed). We had to update every import...
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