NetJs.Compiler 1.0.10

dotnet tool install --global NetJs.Compiler --version 1.0.10
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local NetJs.Compiler --version 1.0.10
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=NetJs.Compiler&version=1.0.10
                    
nuke :add-package NetJs.Compiler --version 1.0.10
                    

Build C# into native javascript with official dotnet runtime and aspnetcore support.

USAGE

Enter the directory where the project is and execute dotnet build first to make sure project builds. Then execute NetJs build.

Supports and tested with Sdks Microsoft.NET.Sdk.BlazorWebAssembly, Microsoft.NET.Sdk.Razor, Microsoft.NET.Sdk

NOTES

If building a razor project or any project with source generators, you must have <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> in your PropertyGroup or execute dotnet build -p:EmitCompilerGeneratedFiles=true first.

This ensures that the csharp code files are generated into the obj directory first. They are picked up by NetJs for traspilation.

CODE SIZE AND MINIFICATION

By default, identifiers for namespace, class and members are maintained as is.

Given

namespace Long.Namespace
{
	static class LongClassName
	{
		static void VeryVeryLongMemberName()
		{

		}
	}
}

Accessing VeryVeryLongMemberName will will emit $assembly.Long.Namespace.LongClassName.VeryVeryLongMemberName. This can make the js file heavy.

You can enable name minification using <NetJsBuildFlags>Global,InlineConstants,SingleFile,MinifyNamespaces,MinifyTypeNames,MinifyMemberNames,ShortNamesCreateFromCamelCase</NetJsBuildFlags>

This is now emitted like $assembly.LN.L.V

More details later...

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.

This package has no dependencies.

Version Downloads Last Updated
1.0.10 97 8/29/2026
1.0.9 99 8/29/2026
1.0.8 271 7/29/2026
1.0.7 113 7/29/2026
1.0.6 110 7/29/2026
1.0.5 112 7/29/2026
1.0.4 115 7/29/2026
1.0.3 116 7/29/2026
1.0.2 119 7/22/2026
1.0.1 117 7/22/2026
1.0.0 128 7/22/2026