How do I minimize the size of a Flutter Web Release? Is the NOTICES File required?

Viewed 2067

My web folder after building my Flutter Web app comes to 5.4MB which isn't too bad, but I might as well optimize.

I was wondering if anybody has any tips outside the obvious(removing unnecessary packages), to minimize the file size? I'll be hosting on Firebase.

Also, there is a NOTICES file which is about 1MB filled with random licenses/copyright disclaimers, are there any consequences to deleting this?

Is flutter build web all you do to build a release version? Is there anything else that should be done other than flutter clean?

1 Answers

According to flutter document, There is a option available for all platforms but not available for web so far. Read the full document

This command will help you to get a minimized size of build except web

flutter build apk --analyze-size
flutter build appbundle --analyze-size
flutter build ios --analyze-size
flutter build linux --analyze-size
flutter build macos --analyze-size
flutter build windows --analyze-size
Related