flutter-packages
flutter-packages copied to clipboard
Investigate ways to reduce .js bundle size on web
Package
google_fonts
Existing issue?
- [X] I checked the existing issues
What happened?
google_fonts library JavaScript itself has the file size of 8Mb. It is only library JavaScript, so fonts are loaded additionally and have their own file sizes.
Might be nice to reduce the library JavaScript file size to something acceptable for the web.
google_fonts_base.dart.lib.js size 8Mb
Relevant log output
No response
I am interested in that topic as well to bring down the bundle size for web. Is HTTP fetching at runtime enabled by default for Flutter Web? If that were the case it would at least not be a blocking call
Why is file size a concern for local, debug-mode development?
However, this does bring up the concern for release mode, where a minimal app has a main.dart.js with an uncompressed 4.1MB size, up from 1.7MB.
minimal app with google_fonts |
minimal app |
|---|---|
![]() |
![]() |
Is HTTP fetching at runtime enabled by default for Flutter Web? HTTP fetching is the default, and can be turned off with https://pub.dev/documentation/google_fonts/latest/google_fonts/GoogleFonts/config.html


