Skip to content

Commit 02cf7de

Browse files
committed
Enable IL trimming to reduce 207-assembly WASM payload
Without trimming the app ships 207 assemblies (~50 MB) causing GitHub Pages CDN to 503-rate-limit some parallel requests. Trimming removes unused BCL types and should cut file count significantly. HealthKitData.Core, EPPlus, and Newtonsoft.Json are rooted (not trimmed) because they use reflection internally. https://claude.ai/code/session_01GwHuC47PH81Zw3EUfgkrYN
1 parent 58e7560 commit 02cf7de

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/HealthNerd.Wasm/HealthNerd.Wasm.csproj

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7-
<!-- Trimming disabled: HealthKitData.Core and EPPlus use XML reflection -->
8-
<PublishTrimmed>false</PublishTrimmed>
7+
<!-- Trimming enabled to reduce the 200+ assembly payload.
8+
Reflection-heavy packages are rooted via TrimmerRootAssembly below. -->
9+
<PublishTrimmed>true</PublishTrimmed>
910
</PropertyGroup>
1011

1112
<ItemGroup>
@@ -18,4 +19,12 @@
1819
<PackageReference Include="Disposing" Version="1.0.0" />
1920
</ItemGroup>
2021

22+
<!-- Preserve assemblies that use reflection internally so the trimmer
23+
doesn't remove members they need at runtime. -->
24+
<ItemGroup>
25+
<TrimmerRootAssembly Include="HealthKitData.Core" />
26+
<TrimmerRootAssembly Include="EPPlus" />
27+
<TrimmerRootAssembly Include="Newtonsoft.Json" />
28+
</ItemGroup>
29+
2130
</Project>

0 commit comments

Comments
 (0)