a “normal” WebAssembly build ought to end up producing something like this:
Size of original WebAssembly binary: 8.81 MB
Size after stripping debug symbols: 6.17 MB
Size after optimization: 3.91 MB
shockingly, after adding a dependency on WebAPIKit, it ballooned to
Size of original WebAssembly binary: 59.56 MB
Size after stripping debug symbols: 52.24 MB
as it turns out, WebAPIKit vends an overlay of Foundation
, which is gated by #canImport(Foundation)
.
of course, just because one Can Import Foundation, does not mean one Should Import Foundation.
how can i disable #canImport(Foundation)
availability at the package level, and apply this to dependencies such as the ECMAScript module from WebAPIKit?