-
Notifications
You must be signed in to change notification settings - Fork 300
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
Decrease browser bundle size #679
Comments
Thank you for looking into this!
I agree, we should get rid of the polyfill for async/await and generators. We can assume support for those features in the tooling by now. |
Looking at the bundle files for
lib.esm
for example:(this was generated in an Astro.js project with
rollup-plugin-visualizer
).I was especially curious why
lib.esm/browser/fileReader.js
is so big even though the source file is only a few lines. Runningyarn run build-transpile-esm
results in a 14kb file. The problem is that babel includes all the following functions:Most of which is not needed for more or less modern browsers anymore.
I'm not an expert in babel and npm package bundling, but AFAIK it's nowadays best practice for a JS library to kinda just ship the source, so that the bundler in the project that consumes the library can optimize for the browsers they want to support and tree-shake away the functions not used?
The text was updated successfully, but these errors were encountered: