CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever 1.0.323.365

dotnet add package CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever --version 1.0.323.365
                    
NuGet\Install-Package CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever -Version 1.0.323.365
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever" Version="1.0.323.365" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever" Version="1.0.323.365" />
                    
Directory.Packages.props
<PackageReference Include="CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever --version 1.0.323.365
                    
#r "nuget: CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever, 1.0.323.365"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever@1.0.323.365
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever&version=1.0.323.365
                    
Install as a Cake Addin
#tool nuget:?package=CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever&version=1.0.323.365
                    
Install as a Cake Tool

CodeBrix.WebPlatform.WasmShrink

The WebAssembly size optimizer for the CodeBrix.WebPlatform web application platform. The package carries the wasm-opt program for every supported build platform, together with a small .NET library that finds the copy for the current machine, makes it runnable, and runs it - so a build shrinks the WebAssembly it produces without anything being installed. CodeBrix.WebPlatform.WasmShrink is provided as a .NET 10 library and associated CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever NuGet package.

CodeBrix.WebPlatform.WasmShrink supports applications and assemblies that target Microsoft .NET version 10.0 and later. Microsoft .NET version 10.0 is a Long-Term Supported (LTS) version of .NET, and was released on Nov 11, 2025; and will be actively supported by Microsoft until Nov 14, 2028. Please update your C#/.NET code and projects to the latest LTS version of Microsoft .NET.

Installation

dotnet add package CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever

Note that the NuGet package ID and the namespace are different - there is no package named plain CodeBrix.WebPlatform.WasmShrink:

  • NuGet package ID: CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever
  • Assembly and primary namespace: CodeBrix.WebPlatform.WasmShrink - i.e. using CodeBrix.WebPlatform.WasmShrink;

XML documentation (IntelliSense) ships alongside the assembly.

CodeBrix.WebPlatform.WasmShrink has no dependencies other than .NET.

CodeBrix.WebPlatform.WasmShrink supports:

  • Shrinking a WebAssembly file with one call, choosing between the smallest file and the fastest code
  • Keeping or removing debug information, so a development build can still show readable failures
  • Running the optimizer with any arguments of your own and reading its exit code and output
  • Handing another build tool the optimizer: a folder holding only that program, ready to be placed on PATH
  • The build platforms of CodeBrix.WebPlatform: Linux x64 and ARM64, Windows x64, macOS on Apple Silicon and Intel
  • Nothing to install: the program arrives with the package and is copied beside the application that references it
  • No Node.js: nothing here uses, needs or talks to it

Requirements

The package is used by the program that builds an application, on the machine that builds it. It is not part of the built web application and is not needed where that application runs.

On Linux the optimizer needs the GNU C library, as found on Debian-based distributions; distributions built on a different C library are not supported.

Sample Code

Shrink a WebAssembly file

using CodeBrix.WebPlatform.WasmShrink;

await WasmShrinkTool.ShrinkAsync("app.wasm", "app.wasm");

Choose what to optimize for

using CodeBrix.WebPlatform.WasmShrink;

var options = new WasmShrinkOptions
{
    Level = WasmShrinkLevel.O3,   // fastest code; the default, Oz, gives the smallest file
    KeepDebugInfo = true,         // keep function names for readable failures
};
options.AdditionalArguments.Add("--enable-bulk-memory");

await WasmShrinkTool.ShrinkAsync("app.wasm", "app.min.wasm", options);

Let another build tool find the optimizer

using System.Diagnostics;
using CodeBrix.WebPlatform.WasmShrink;

var startInfo = new ProcessStartInfo("my-build-tool");
startInfo.Environment["PATH"] = WasmShrinkTool.PrependToPath();

Run it with your own arguments

using CodeBrix.WebPlatform.WasmShrink;

WasmShrinkResult result = await WasmShrinkTool.RunAsync(new[] { "app.wasm", "--print" });
if (!result.Succeeded)
{
    Console.Error.WriteLine(result.StandardError);
}

Documentation

The NuGet package includes AGENT-README.txt, a complete API reference and usage guide written for AI coding agents - point your agent at that file when it is writing code against this library.

Additional sample code and usage examples are available in the CodeBrix.WebPlatform.WasmShrink.Tests project: https://github.com/ellisnet/CodeBrix.WebPlatform.WasmShrink/tree/main/tests/CodeBrix.WebPlatform.WasmShrink.Tests

License

CodeBrix.WebPlatform.WasmShrink is licensed under the Apache License 2.0 - see the LICENSE file.

For licensing and provenance information about the open source code included in this package, see THIRD-PARTY-NOTICES.txt.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CodeBrix.WebPlatform.WasmShrink.ApacheLicenseForever:

Package Downloads
CodeBrix.WebPlatform.FrontendBuilder.ApacheLicenseForever

The build-time library a build program calls to build the Rust WebAssembly frontend of a CodeBrix.WebPlatform application: it checks the prerequisites and says what is missing, writes the client code generated from the compiled backend, the platform's shared Rust crate, the platform's Rust crates (carried as one archive, with their notices) and the cargo configuration into the frontend, so that plain cargo works there offline, and runs the Dioxus build tool to build or serve the site, shrinking release builds with the packaged wasm-opt. No Node.js. It is used while an application is built and is not part of the built application.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.323.365 89 11/19/2026