Electron.NET icon indicating copy to clipboard operation
Electron.NET copied to clipboard

Add PublishTrimmed option

Open aikrana opened this issue 3 years ago • 1 comments

Would be nice to add this option (as well as PupblishSingleFile was) to reduce the exe file size in windows

aikrana avatar Dec 20 '21 18:12 aikrana

You can add the option to the project configuration file.

Example of file.csproj

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net5.0</TargetFramework>
    <PublishTrimmed>true</PublishTrimmed>
    <TrimMode>CopyUsed</TrimMode>
  </PropertyGroup>
</Project>

After that the command dotnet electronize build /target win produce a trimmed assembly.

NOTE: I haven't tested the other target platforms.

m3nax avatar Apr 07 '22 15:04 m3nax