NetPack.Build 0.6.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package NetPack.Build --version 0.6.0
                    
NuGet\Install-Package NetPack.Build -Version 0.6.0
                    
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="NetPack.Build" Version="0.6.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetPack.Build" Version="0.6.0" />
                    
Directory.Packages.props
<PackageReference Include="NetPack.Build">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 NetPack.Build --version 0.6.0
                    
#r "nuget: NetPack.Build, 0.6.0"
                    
#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 NetPack.Build@0.6.0
                    
#: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=NetPack.Build&version=0.6.0
                    
Install as a Cake Addin
#tool nuget:?package=NetPack.Build&version=0.6.0
                    
Install as a Cake Tool

<p align="center"> <a href="https://netpack.anglevisions.com"><img src="https://raw.githubusercontent.com/FlorianRappl/netpack/main/art/icon.png" alt="netpack" width="120" height="120" /></a> </p>

NetPack.Build

Bundle your web assets as part of the .NET build.

Website · Documentation · Source · CLI on npm

This package wires netpack into MSBuild: on dotnet build (or publish) it bundles and optimizes your JavaScript / TypeScript / JSX / CSS / HTML entry point straight into wwwroot — ideal for ASP.NET Core apps.

It's built on NetPack.Core and ships a cross-platform, pure-managed image processor (ImageSharp) — no SkiaSharp, no native/OS dependency. Everything the task needs is bundled, so it adds no package references to your project.

Install

dotnet add package NetPack.Build

Use

Point it at an entry file and build:

<PropertyGroup>
  <NetpackEntry>ClientApp/src/index.html</NetpackEntry>
</PropertyGroup>
dotnet build
# -> wwwroot/index.html, wwwroot/index.js, wwwroot/styles.css, …

That's it — bundling runs after Build whenever NetpackEntry is set.

Options

All are MSBuild properties with sensible defaults:

Property Default Purpose
NetpackEntry entry file (enables the integration when set)
NetpackOutputDirectory $(MSBuildProjectDirectory)/wwwroot output folder
NetpackMinify true minify + tree-shake
NetpackSourceMaps false emit source maps
NetpackFormat esm esm / cjs / umd / systemjs
NetpackPlatform web web / node / deno
NetpackEntryNames [name] naming template, e.g. [name]-[hash]
NetpackPublicPath base URL/path for emitted-file references

Keep dependencies external with an item group:

<ItemGroup>
  <NetpackExternal Include="react" />
  <NetpackExternal Include="react-dom" />
</ItemGroup>

Notes

  • No native dependency. Image resizing/re-encoding uses ImageSharp (Apache-2.0, the 2.1.x line). Formats it doesn't cover (.avif, .ico) are copied as-is.
  • Build with the .NET SDK. The task targets .NET 8, so build via dotnet build / dotnet msbuild (the SDK's .NET-based MSBuild).
  • Node.js is only needed for the optional Sass/Less/PostCSS/Svelte features; plain JS/TS/JSX/CSS/HTML bundling needs nothing extra.
  • Prefer the API directly? Use NetPack.Core. Prefer a CLI? npm i -D netpack.

MIT licensed — https://github.com/FlorianRappl/netpack.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.2 0 8/19/2026
0.8.1 92 8/12/2026
0.8.0 88 8/7/2026
0.7.0 95 8/3/2026
0.6.0 93 7/27/2026
0.5.2 104 7/24/2026
0.5.1 98 7/24/2026