Skip to content

Commit b9bef52

Browse files
committed
build: remove CDN dependencies for flutter web build
1 parent 7f4cbcd commit b9bef52

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

build.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,17 @@ build-web() {
119119
cd "$awldir"
120120
rm -rf static/
121121
cd "$awlflutterdir"
122-
flutter build web --release
122+
flutter build web --release --no-web-resources-cdn --pwa-strategy=none --csp
123+
# TODO: compress static dir into a .zip to save ~6 MB per binary (10 MB --> 4 MB)
123124
cp -r "$awlflutterdir/build/web" "$awldir/static"
124125
cd "$awldir"
125-
# at the time of flutter 3.3, canvaskit is saved in build files, but still not used in release run (using CDN instead)
126-
# so we don't need extra 15 MB in our binaries
127-
# see https://stackoverflow.com/q/70747972 with answer from core team
128-
rm -rf static/canvaskit
126+
# unused canvaskit variants
127+
rm -rf static/canvaskit/*symbols
128+
rm -rf static/canvaskit/skwasm*
129+
rm -rf static/canvaskit/chromium
130+
# extra 1.3 MB for "About Anywherelan" -> "VIEW LICENSES" page
131+
# note: compressed it doesn't take much space
132+
rm -rf static/assets/NOTICES
129133
}
130134

131135
# build android library

0 commit comments

Comments
 (0)